DEV Community

Towry
Towry

Posted on

Answer: Angular2 How can I override provider

https://angular.io/guide/ngmodule-faq#what-if-two-modules-provide-the-same-service

What if two modules provide the same service? When two imported modules, loaded at the same time, list a provider with the same token, the second module's provider "wins". That's because both providers are added to the same injector.

When Angular looks to inject a service for that token…

Top comments (0)