In the project I am currently working on, navigation is primarily done through Ajax loading of HTML templates. The Angular Loading Bar feature is proving to be quite effective in this setup, as it employs interceptors to keep track of most $http
requests. What's interesting is that it also includes start()
and complete()
methods which function exactly as I need them to - initiating and stopping the loading indicator without being dependent on any specific $http
request.
However, I am facing a challenge in trying to access this service either directly or by injecting it into a controller in order to utilize these two essential methods. The only mention of this service can be found at the beginning of the Angular app:
var MlamAngularApp = angular.module('MlamAngularApp', ['kendo.directives', 'ngRoute', 'angular-loading-bar', 'ngAnimate']);
MlamAngularApp.config(['cfpLoadingBarProvider', function (cfpLoadingBarProvider) {
cfpLoadingBarProvider.includeSpinner = true;
cfpLoadingBarProvider.includeBar = true;
}]);
This is followed by numerous declarations of services, factories, and controllers such as:
MlamAngularApp.service('QuoteService', QuoteService);
MlamAngularApp.factory('ApplicationCancelFactory', ApplicationCancelFactory);
MlamAngularApp.controller('MlamController', MlamController);
I have a feeling that the Loading Bar should be included somewhere within these declarations, but I am unsure of where or how to do so.