src/bs4-selectbox.directive.js
function checkLater() {
        setTimeout(function () {
            ctrl.options(ctrl.searchTerms, function (options) {
                ctrl._options = options;
                if (options.length === 0) checkLater();
                $scope.$apply();
            });
        }, 1000);
    }
function checkLater() {
        setTimeout(function () {
            ctrl.options(ctrl.searchTerms, function (options) {
                ctrl._options = options;
                if (options.length === 0) checkLater();
                $scope.$apply();
            });
        }, 1000);
    }
function checkLater ( ) { setTimeout ( function ( ) { ctrl . options ( ctrl . searchTerms , function ( options ) { ctrl . _options = options ; if ( options . length === 0 ) checkLater ( ) ; $scope . $apply ( ) ; } ) ; } , 1000 ) ; }
Sometimes options cannot return before some other stuff has been initialized Loop and check periodically until there is some data.
Sometimes options cannot return before some other stuff has been initialized Loop and check periodically until there is some data .