Angular : How to extend HttpClient? Angular : How to extend HttpClient? angular angular

Angular : How to extend HttpClient?


Instead of extending HttpClient, I would take one of three approaches:

  1. 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

  1. Write a delegating Interceptor, that decides which other Interceptors to delegate to, depending on your requirements.

or

  1. Just write one big Interceptor that decides what do based on the URL / whatever you need.

My gut would be to go with #1