Suppose I registered several HTTP interceptors in angular.js app:
$httpProvider.interceptors.push(function() {
return {
request: function(config) {
console.log("interceptor A request");
return config;
},
response: function(res) {
console.log("interceptor A response");
return res;
}
};
});
$httpProvider.interceptors.push(...); // interceptor B with similar code
$httpProvider.interceptors.push(...); // interceptor C with similar code
In which order will they be executed?
It seems that the interceptors are executed:
Log:
interceptor A request
interceptor B request
interceptor C request
(request happens here)
interceptor C response
interceptor B response
interceptor A response
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With