I am new to angular (and programming), here is a seemingly simple question but I could not figure it out.
some tutorials suggests using $httpProvider.interceptors.push('interceptorName')
to manipulate the http request and response.
I want to know more about the interceptor thing so I look at the official document, but I could not find anything related to interceptor, there are only a method (useApplyAsync([value]);) and a property (defaults) in $httpProvider
(docs).
I know from other tutorials that an interceptor is a regular service factory and I know how to use it, but my question is: since the syntax is $httpProvider.interceptors.push('interceptorName')
, then I expect I will find a property called "interceptors" in $httpProvider
, but in fact I can't. Is something I miss to get this confusion? or is my concept totally wrong from the bottom?