Closed teswar closed 7 years ago
The thing is services should always remain as singletons meaning they are only of one instance no matter where you are injecting it (any component or service).
That said all registered interceptors always global.
I understand the singleton concept. In my project there a independent service to each resources, where HttpInterceptorService is being injected via constructor and most of the API calls need OAuth Token attached to the header. The problem is I can't be certain which service will always be firstly created, so that the interceptors can be configured in that service. Else I have to configure in the base-service, which is inherited by all my resource-services.
But I am able to do this in the main app's module level. I will not have to be worried about these rite ?
I'm sure you can do that from main app.
However I'm not sure I can see the problem why you ever should be worried about services construction order? Can you please provide some example use case?
I'm going to close this assuming your issue was resolved
Yeap. Thnx...
Did you go through the example use case? You can set interceptors that way from any component or service you want.