Hello dear community!
i need some help with one of my response interceptors. I don't really get
the code myself (not my project) and would need some help in generating a
equivalent angular 1.3 'thingy'.
Here is my code snippet:
.config(['$httpProvider', function ($httpProvider, $rootScope) {
var interceptor = ['$q', '$location', '$rootScope', function ($q,
$location, scope) {
function success(response) {
return response;
}
function error(response) {
if (response.status === 403) {
scope.session.softlogout();
}
return $q.reject(response);
}
return function (promise) {
return promise.then(success, error);
}
}];
$httpProvider.responseInterceptors.push(interceptor);
Do you guys know how to get the same code running in angularjs 1.3?
Best regards!
Michael
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.