<script type="text/javascript" src="/vendor/angular-spinner/angular-spinner.js"></script> .factory('httpInterceptor', function ($q,usSpinnerService, $rootScope, $log) { var numLoadings = 0; return { request: function (config) { numLoadings++; // Show loader // $rootScope.$broadcast("loading-started"); usSpinnerService.spin('spinner-1'); return config || $q.when(config) }, response: function (response) { ...