I have a application that uses a plugin that register a HttpInterceptor.
Now I need to create my own interceptor that need to be run before the other interceptor because it will change some values, in localStorage, that the other interceptor uses.
How can I influence in the execution order when registering a new HttpInterceptor?
https://angular.io/guide/http#interceptor-order
Angular applies interceptors in the order that you provide them. If you provide interceptors A, then B, then C, requests flow in A->B->C and responses flow out C->B->A.
You cannot set interceptors order. Interceptors are chained in order they are declared.
You will have write your own super interceptor that will allow to append child interceptors with some ordering logic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With