#axios

1 messages · Page 1 of 1 (latest)

vast delta
#

i want to set a global axios interceptor for all my routes, i didn't find a way in the documentation , anyone can help with that?
the only way that i found is to set the interceptor after every time i inject it, is there another way to do it globally (for all routes)?

ionic cove
#

Yes, you create a module in which you configure the singleton HttpService and export it.
All other modules that need axios will import that module and get the same configured instance of Httpservice

vast delta
#

how i do that ? can i configure the service without injecting it ?

ionic cove
vast delta
#

just to be sure, you are suggesting injecting it in the HttpModule constructor?
if that is not what you are suggesting, i don't like this approach because the injection will be in some random service but it will be apply everywhere

ionic cove