Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Last active December 24, 2015 02:49
Show Gist options
  • Save ianjosephwilson/6733492 to your computer and use it in GitHub Desktop.
Save ianjosephwilson/6733492 to your computer and use it in GitHub Desktop.
loading manager
$httpProvider.responseInterceptors.push(function ($q, LoadingManager) {
return function (promise) {
LoadingManager.startLoading();
return promise.then(function (response) {
LoadingManager.stopLoading();
return response;
}, function (response) {
LoadingManager.stopLoading();
return $q.reject(response);
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment