Yes, Angular supports multiple interceptors at a time. You could define multiple interceptors in providers property:
1 2 3 4 |
providers: [ { provide: HTTP_INTERCEPTORS, useClass: MyFirstInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: MySecondInterceptor, multi: true } ], |
The interceptors will be called in the order in which they were provided. i.e, MyFirstInterceptor will be called first in the above interceptors configuration.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.