I get this error for unknown reasons while trying to implement the AJAX Spinner download code.
I do not understand where the title should be indicated. I did console.log(config) , but I see there the value of headers: accept: text/html .
Below is my code:
/** * Spinner Service */ //Spinner Constants diary.constant('START_REQUEST','START_REQUEST'); diary.constant('END_REQUEST','END_REQUEST'); //Register the interceptor service diary.factory('ajaxInterceptor', ['$injector','START_REQUEST', 'END_REQUEST', function ($injector, START_REQUEST, END_REQUEST) { var $http, $rootScope, myAjaxInterceptor = { request: function (config) { $http = $http || $injector.get('$http'); if ($http.pendingRequests.length < 1) { console.log(config); $rootScope = $rootScope || $injector.get('$rootScope'); $rootScope.$broadcast(START_REQUEST); } } }; return myAjaxInterceptor; }]); diary.config(['$httpProvider', function ($httpProvider) { $httpProvider.interceptors.push('ajaxInterceptor'); }]);
source share