Angular : How to extend HttpClient?
Instead of extending HttpClient, I would take one of three approaches:
- Have each of your Interceptors inspect the URL of the request, and either do it's work, or just call
next.handle(req)
without doing anything else, depending on the URL
or
- Write a delegating Interceptor, that decides which other Interceptors to delegate to, depending on your requirements.
or
- Just write one big Interceptor that decides what do based on the URL / whatever you need.
My gut would be to go with #1