Domanda

We can modify the data using the interceptors and the transformRequest and transformresponse.

What is then the difference except for the fact that interceptors can only be added at the global level?

Also, even the loading of the partials is a HTTP get request and the data is returned in response. How does one deal with that ?

È stato utile?

Soluzione

Differences Between Transformers and Interceptors

An interceptor can be used to intercept the request/response at various points, as discussed above. But transformers can be applied just before sending a request or after receiving a response. Another important consideration is that, using transformers, you just get access to data and headers of request/response while interceptors have access to the config object.

From AngularJS - Novice To Ninja by Sandeep Panda.

Also, I think interceptors are global while transformers can be global or per request.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top