-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Open
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercompiler: template type-checkingfreq2: mediumstate: confirmedtype: bug/fixworkaround4: none
Milestone
Description
🐞 bug report
Affected Package
The issue is caused by package @angular/compiler or @angular/language-service?Is this a regression?
no
Description
Using optional chaining (or safe navigation operator) in templates uses null, but the language-service and compiler (with strictTemplates) treat it as undefined.
This is not a request to change null to undefined (that's proposed by #34385). Instead I want the static types to be correct so I'm not surprised by the different semantics of Angular's safe navigation operator compared to TypeScript/ECMAScript.
🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-ivy-hh5mwz?file=src%2Fapp%2Fapp.component.ts
🔥 Exception or Error
🌍 Your Environment
Angular Version:
9.1.11
Anything else relevant?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilercompiler: template type-checkingfreq2: mediumstate: confirmedtype: bug/fixworkaround4: none