[Feature] Introduce Type-safe Token Providing #55555
Labels
area: core
Issues related to the framework runtime
core: di
cross-cutting: types
feature
Issue that requests a new feature
Milestone
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
The current object-literal-based providing syntax cannot ensure:
multi: true
option is not missing or mistakenly addedFor libraries, in order to ensure type-safe providing, it has been a common pattern to create
provideXxx
helpers. However, in daily application development, the providng experience is still non-type-safe.Since all the
ProviderToken
s carry type information, it is possible to create framework-level providing helpers to ensure type safety.I have created such helper functions and fully adopted it in all my projects.
I would like to create a PR to introduce these helpers to
@angular/core
to enable a safer providing experience for all Angular developers.Please see below for details.
Proposed solution
Signatures
Usage
Implementation
Alternatives considered
N/A
The text was updated successfully, but these errors were encountered: