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
The @ViewChild decorator does not select providers defined through a string token #38313
Labels
Milestone
Comments
ghost
mentioned this issue
Jul 31, 2020
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Aug 1, 2020
Queries weren't matching directives that provide themselves via string injection tokens, because the assumption was that any string passed to a query decorator refers to a template reference. These changes make it so we match both template references and providers while giving precedence to the template references. Fixes angular#38313. Fixes angular#38315.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Aug 1, 2020
Queries weren't matching directives that provide themselves via string injection tokens, because the assumption was that any string passed to a query decorator refers to a template reference. These changes make it so we match both template references and providers while giving precedence to the template references. Fixes angular#38313. Fixes angular#38315.
crisbeto
added a commit
to crisbeto/angular
that referenced
this issue
Aug 9, 2020
Queries weren't matching directives that provide themselves via string injection tokens, because the assumption was that any string passed to a query decorator refers to a template reference. These changes make it so we match both template references and providers while giving precedence to the template references. Fixes angular#38313. Fixes angular#38315.
AndrewKushnir
pushed a commit
that referenced
this issue
Aug 10, 2020
Queries weren't matching directives that provide themselves via string injection tokens, because the assumption was that any string passed to a query decorator refers to a template reference. These changes make it so we match both template references and providers while giving precedence to the template references. Fixes #38313. Fixes #38315. PR Close #38321
profanis
pushed a commit
to profanis/angular
that referenced
this issue
Sep 5, 2020
Queries weren't matching directives that provide themselves via string injection tokens, because the assumption was that any string passed to a query decorator refers to a template reference. These changes make it so we match both template references and providers while giving precedence to the template references. Fixes angular#38313. Fixes angular#38315. PR Close angular#38321
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
馃悶 bug report
Affected Package
The issue is caused by package
@angular/core
.Is this a regression?
Yes. This bug was not present before version 9 when Ivy was enabled by default. With ViewEngine, this bug is not present.
Description
In the documentation for the
@ViewChild
decorator, one of the accepted selectors is stated as:However, with Ivy enabled, using this type of selector returns an undefined value. With ViewEngine, it works as described and returns a value.
馃敩 Minimal Reproduction
https://stackblitz.com/edit/view-child-string-token-provider-selector
馃敟 Exception or Error
No error,
@ViewChild
just returns an undefined value.馃實 Your Environment
The text was updated successfully, but these errors were encountered: