What is the order of execution of $http interceptors in AngularJS?

Viewed 2662

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?

1 Answers
Related