Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

There should be a type alias for types that can be used as an injection token #39792

Closed
mitchellwills opened this issue Nov 20, 2020 · 1 comment
Assignees
Labels
area: core Issues related to the framework runtime feature Issue that requests a new feature state: has PR
Milestone

Comments

@mitchellwills
Copy link
Contributor

mitchellwills commented Nov 20, 2020

馃殌 feature request

Relevant Package

This feature request is for @angular/core

Description

There should be a type alias defined for values that can be used as an "injection token". Today I think that is roughly Type<T>|AbstractType<T>|InjectionToken<T>. This type is repeated all over and defining a consistent alias would make it easier to update in the future and simplify code passing tokens around.

Forked from #37958

Describe the solution you'd like

type ????Token<T> = Type<T>|AbstractType<T>|InjectionToken<T>

Not really sure on a name

@AndrewKushnir AndrewKushnir added area: core Issues related to the framework runtime feature Issue that requests a new feature labels Nov 20, 2020
@ngbot ngbot bot modified the milestone: Backlog Nov 20, 2020
@crisbeto crisbeto self-assigned this Apr 12, 2021
crisbeto added a commit to crisbeto/angular that referenced this issue Apr 12, 2021
Currently we have a lot of places where we repeat the type `Type<T>|AbstractType<T>|InjectionToken<T>` which makes it cumbersome to add another type or to type something else with the same signature.

These changes add a new type that can be used instead.

Fixes angular#39792.
crisbeto added a commit to crisbeto/angular that referenced this issue Apr 19, 2021
Currently we have a lot of places where we repeat the type `Type<T>|AbstractType<T>|InjectionToken<T>` which makes it cumbersome to add another type or to type something else with the same signature.

These changes add a new type that can be used instead.

Fixes angular#39792.
crisbeto added a commit to crisbeto/angular that referenced this issue Apr 20, 2021
Currently we have a lot of places where we repeat the type `Type<T>|AbstractType<T>|InjectionToken<T>` which makes it cumbersome to add another type or to type something else with the same signature.

These changes add a new type that can be used instead.

Fixes angular#39792.
jessicajaniuk pushed a commit that referenced this issue Apr 22, 2021
Currently we have a lot of places where we repeat the type `Type<T>|AbstractType<T>|InjectionToken<T>` which makes it cumbersome to add another type or to type something else with the same signature.

These changes add a new type that can be used instead.

Fixes #39792.

PR Close #41580
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime feature Issue that requests a new feature state: has PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants