Last active
December 24, 2015 02:49
-
-
Save ianjosephwilson/6733492 to your computer and use it in GitHub Desktop.
loading manager
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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