From 127479f5c8c84bd1557c8f08106e5f9b34c63659 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 20 Nov 2014 17:07:49 +0200 Subject: [PATCH] Create new promises on every request. --- src/services/interceptor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/interceptor.js b/src/services/interceptor.js index 68dc95f..2fa431f 100644 --- a/src/services/interceptor.js +++ b/src/services/interceptor.js @@ -1,6 +1,5 @@ angular.module('ngLoading.interceptor', []) .factory('Interceptor', ['$document', '$injector', '$q', 'loading', '$log', function($document, $injector, $q, loading, $log) { - var defer = $q.defer(); var overlay, loadConfig; return { start: function() { @@ -16,6 +15,8 @@ angular.module('ngLoading.interceptor', []) }); }, request: function(config) { + var defer = $q.defer(); + //disable loading screen for a per request basis if(config.showLoading === false) return config; @@ -42,4 +43,4 @@ angular.module('ngLoading.interceptor', []) return response; } }; -}]); \ No newline at end of file +}]);