Internally support `providedIn: environment`
refactor(core): internally support `providedIn: environment` (#45626)
Internally support `providedIn: environment`refactorinternally support providedin environment core
Committed by alxhub
commit message
refactor(core): internally support `providedIn: environment` (#45626)
This commit adds a new internal scope to `R3Injector` for
`EnvironmentInjector`s specifically. This will allow us to scope services to
the environment side of the injector hierarchy specifically, as opposed to
the `'any'` scope which also includes view-side injectors created via
`Injector.create`. For now, this functionality is not exposed publicly, but
is available to use within `@angular/core` only.
PR Close #45626Editor assessment
An exemplary internals message. The subject states the capability — `providedIn: environment` is supported internally — under an accurate `refactor(core)` pairing. The body teaches the design in full: a new scope is added to `R3Injector` for `EnvironmentInjector`s specifically, allowing services to be scoped to the environment side of the hierarchy rather than the `'any'` scope that also includes view-side injectors from `Injector.create`, and it is explicit that the feature is not yet public. Mechanism, contrast, and rollout status in one paragraph. The `PR Close #45626` footer is well formed. Style is clean throughout — imperative subject, no trailing period, no junk.