Created
July 29, 2015 15:31
-
-
Save himetani/19c9dfdd93ff94a0b00b to your computer and use it in GitHub Desktop.
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
angular.module('myApp', ['restangular']) | |
.run(function($rootScope, $state, Restangular, user) { | |
Restangular.setErrorInterceptor(function(response, deferred, responseHandler) { | |
if(response.status === 401) { | |
$state.go('login') | |
} | |
else if(response.status === 409) { | |
// send signal to SignupController | |
$rootScope.$broadcast('conflict') | |
} | |
return false | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment