Angular js 1.x provides the $http service to allow the client side to communicate with the backed using HTTP requests. For most complex usages it is often necessary to do some processing with the requests/responses before they reach our controllers. For example, one might be looking to implement a global error handler that displays a fixed error page for any server side errors.
Interceptors are basically an array of services available to the $httpProvider service that pass the HTTP requests and/or responses through these services to perform necessary operations such as logging, error handling etc. before the requests are forwarded to the server or the responses are made available to the controllers.
There are four kinds of interceptors available:
Princeton IT is the leading AngularJS development company in USA. Get in touch!