Consider supporting forwardRef
in providedIn
fields of @Injectable decorators
#41205
Labels
area: core
Issues related to the framework runtime
feature
Issue that requests a new feature
state: has PR
Milestone
🚀 feature request
Relevant Package
@angular/core
Description
@Injectable
decorators support passing an NgModule reference as a value of theprovidedIn
field, for ex:This makes the provider tree-shakable (as this provider is not referenced directly inside an NgModule def).
Currently, there is no
forwardRef
support in theprovidedIn
field of the@Injectable
decorator, which forces the limitation of defining an NgModule before an Injectable class. In some cases this is very inconvenient, see PR #41126.Describe the solution you'd like
We should consider adding
forwardRef
support to theprovidedIn
property values, so the example above may look like this:The text was updated successfully, but these errors were encountered: