Application behavior
Dependency injection
Inspect which injector supplies a token when a component has a local provider or falls back to its environment.
Angular 22.3.2 · trace
Objective
Predict the scope of a provider and observe how lookup modifiers change the result.
Transcript
Angular 22.3.2
- An InjectionToken identifies a dependency. A provider binds that token to a value, factory, or class.
- The element injector can shadow a value from the environment injector for the component and its descendants.
- With no matching element provider, ordinary injection can reach the environment. The fixture checks both scopes using the same token.
- Optional self lookup returns null when the current element has no provider. Skip-self begins above the current element.