Open gund opened 7 years ago
@gund Angular 4.3 and above HttpClient supports creating native angular interceptors. If you are using it, you should migrate away from using this library I think.
@kenisteward thanks, I know about native support.
But this library still offers at least one feature you will not get from there - changing interceptors at runtime.
I had specifically that requirement in one of my project, so it might be useful for others as well.
And anyway these interceptors are fully compatible with native ones, so you can use one or another or both at the same time =)
I was actually wondering if I have interceptors setup with httpmodule if requests on httpclient would be intercepted with this lib. I don't think it will right?
If you can't get runtime interceptor switches with the base interceptor I'm not sure if updating this to use the new base one will help you right? Unless it is updated to override it fully.
On Tue, Dec 19, 2017, 3:08 PM Alex Malkevich notifications@github.com wrote:
@kenisteward https://github.com/kenisteward thanks, I know about native support.
But this library still offers at least one feature you will not get from there - changing interceptors at runtime.
I had specifically that requirement in one of my project, so it might be useful for others as well.
And anyway these interceptors are fully compatible with native ones, so you can use one or another or both at the same time =)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gund/ng-http-interceptor/issues/170#issuecomment-352872024, or mute the thread https://github.com/notifications/unsubscribe-auth/AMPLtXTQqR1UDVMpyxC1pU-c087P0o_iks5tCBevgaJpZM4QXFZf .
That is the purpose of this issue, to add support for the new http client. And basically I already made it working, only need to make sure AOT will still work.
The reason for me to keep this library is that it is not bound specifically to any http client, it just proxies it without any particular requirements. So if it can manipulate interceptors at runtime with old client, it also will do with the new one. And again, I already tested it locally - it does work perfectly fine =)
How to get the httpClient works with interceptor? I'm stuck on it.
Angular 5 introduced new
@angular/common/http
library so we need to support it in some way.First approach:
HttpInterceptorModule
Second approach:
This will be nicer way but requires some investigation.