#axios
1 messages · Page 1 of 1 (latest)
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
how i do that ? can i configure the service without injecting it ?
You can inject it in the module's constructor and configure it there. Sincr it's a singleton, it will take effect everywhere it's used
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
Yes, in the module's constructor