-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: queriesfreq2: mediumhotlist: components teamRelated to Angular CDK or Angular MaterialRelated to Angular CDK or Angular Materialstate: confirmedstate: has PRtype: bug/fix
Milestone
Description
I'm submitting a...
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
If i have InjectionToken i cant assign it to ViewChildren or ContentChildren as mentioned in #12758 Maybe due to changes of Typescript.
Expected behavior
This code is working if you type it to <any> but without it cant be compiled using typescript.
Minimal reproduction of the problem with instructions
This will not compile :).
export const SomeClassToken = new InjectionToken<SomeClass>('SomeClassToken');
export class TestClass
{
@ViewChildren(SomeClassToken)
public children: QueryList<SomeClass>;
}What is the motivation / use case for changing the behavior?
It should compile, because it works if typed to <any>.
Environment
Angular version: 5.1.2
Browser:
During compilation
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Typescript version: 2.5.3
- Node version: 8.1.2
- Platform: Windows
Others:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: queriesfreq2: mediumhotlist: components teamRelated to Angular CDK or Angular MaterialRelated to Angular CDK or Angular Materialstate: confirmedstate: has PRtype: bug/fix