shlogg · Early preview
Krzysztof Platis @krisplatis

Angular Dependency Injection Order Matters

Angular Dependency Injection order matters. Providers are flattened into one list, with last provided taking precedence in case of conflicts. Last provider wins.

The order of providers in Angular Dependency Injection matters.
If you provide a custom implementation "before" the default implementation is provided, then the default implementation will take precedence. The "last provided" wins. Angular traverses the tree of modules, grabs all providers and flatten them all to one list. In case of conflicts, then the last provided in the list wins.
Angular traverses modules tree, starting from the root module (often named AppModule):

first are providers from imported modules (depth-first), e.g. imports: [SomeModule, ...]
then providers from static methods...