diff --git a/build/loading-bar.js b/build/loading-bar.js index 01630c0..c3fb7a1 100644 --- a/build/loading-bar.js +++ b/build/loading-bar.js @@ -223,11 +223,13 @@ angular.module('cfp.loadingBar', []) $rootScope.$broadcast('cfpLoadingBar:started'); started = true; - if (includeBar) { + var _includeBar = !!(typeof includeBar === 'function' ? includeBar() : includeBar); + if (_includeBar) { $animate.enter(loadingBarContainer, $parent, $after); } - if (includeSpinner) { + var _includeSpinner = !!(typeof includeSpinner === 'function' ? includeSpinner() : includeSpinner); + if (_includeSpinner) { $animate.enter(spinner, $parent, loadingBarContainer); } diff --git a/src/loading-bar.js b/src/loading-bar.js index 44e092a..c915e7e 100644 --- a/src/loading-bar.js +++ b/src/loading-bar.js @@ -217,11 +217,13 @@ angular.module('cfp.loadingBar', []) $rootScope.$broadcast('cfpLoadingBar:started'); started = true; - if (includeBar) { + var _includeBar = !!(typeof includeBar === 'function' ? includeBar() : includeBar); + if (_includeBar) { $animate.enter(loadingBarContainer, $parent, $after); } - if (includeSpinner) { + var _includeSpinner = !!(typeof includeSpinner === 'function' ? includeSpinner() : includeSpinner); + if (_includeSpinner) { $animate.enter(spinner, $parent, loadingBarContainer); }