-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ivy is not complaining about unknown element inside ng-template #36171
Comments
This is due to an architectural change in Ivy. In the previous compiler (ViewEngine), the check for unknown elements would occur during parsing of the template. In Ivy, templates are parsed independently from the corresponding Instead, checking of elements is pushed into the template type checking phase and it's currently affected by the type checker's configuration. With
So maybe I'm mistaken or misinterpreted this statement, or something is not working as I expect it to be. |
Btw, it should certainly be possible to adjust the type checker to handle this differently, independent of |
When I set edit: I have an existing Angular app where |
Yet it's not clear how come Ivy is able to recognize the unknown element when it's outside of |
I can explain that :-) If |
I see the fact that Ivy doesn't complain (without |
As #47601 is closed as a duplicate of this issue, I’d like to add a couple of additional points: In addition to unknow elements inside
(@JoostK Any chance we extend the issue title to be more inclusive of other cases?) |
I'd rather have specific issues for specific conditions, since how addressable they are varies widely. I'm going to close this issue actually, as the basic type-checking mode ( |
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. |
🐞 bug report
Description
Ivy does not complain about an unknown element when this element is placed inside
ng-template
. When it's outside ofng-template
it throws a build error.The issue can only be found in runtime (no component being rendered) or with
fullTemplateTypeCheck: true
.🔬 Minimal Reproduction
tsconfig.json
and updateangularCompilerOptions
toapp.component.html
and update its content to:ng serve
and observe no build errors (<---- Issue here)tsconfig.json
and updateangularCompilerOptions
to:ng serve
and observe a build errortsconfig.json
and updateangularCompilerOptions
toapp.component.html
and update its content to:ng serve
and observe a build error🌍 Your Environment
Angular Version: 9.0.7
Please clarify if the discrepancy in the compiler behavior between steps
3
and5
or8
is an intended behavior.The text was updated successfully, but these errors were encountered: