Skip to content

Commit

Permalink
Merge pull request #8 from mafredri/promise-fix
Browse files Browse the repository at this point in the history
Create new promises on every request.
  • Loading branch information
maseh87 committed Nov 20, 2014
2 parents 6488181 + 127479f commit b3636bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/interceptor.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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;

Expand All @@ -42,4 +43,4 @@ angular.module('ngLoading.interceptor', [])
return response;
}
};
}]);
}]);

0 comments on commit b3636bf

Please sign in to comment.