A root injector is the globally scoped Angular injector created when an application starts. Services declared with providedIn: 'root' are registered there and can be injected throughout the application. section 3.1.3
Angular resolves dependencies through a hierarchy:
- ElementInjectors belong to rendered DOM nodes and can use providers declared on components. section 3.1.3
- Older NgModule applications used ModuleInjectors after ElementInjectors failed to resolve a dependency. section 3.1.3
- Fully standalone applications omit ModuleInjectors and can register providers through routes or main.ts configuration before reaching the root scope. section 3.1.3
Figure 3.2 Diagram illustrating the hierarchy of injectors and dependencies
Use the injector hierarchy diagram to trace how Angular searches for dependencies from component scope toward application-wide providers. section 3.1.3
