
NgIf
context variables in template type checker (#35125)
When the `NgIf` directive is used in a template, its context variables can be used to capture the bound value. This is typically used together with a pipe or function call, where the resulting value is captured in a context variable. There's two syntax forms available: 1. Binding to `NgIfContext.ngIf` using the `as` syntax: ```html <span *ngIf="(user$ | async) as user">{{user.name}}</span> ``` 2. Binding to `NgIfContext.$implicit` using the `let` syntax: ```html <span *ngIf="user$ | async; let user">{{user.name}}</span> ``` Because of the semantics of `ngIf`, it is known that the captured context variable is non-nullable, however the template type checker would not consider them as such and still report errors when `strictNullTypes` is enabled. This commit updates `NgIf`'s context guard to make the types of the context variables non-nullable, avoiding the issue. Fixes #34572 PR Close #35125
build: migrate references and scripts that set to build with ivy via compile=aot to use config=ivy (#33983)
Angular
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
Description
Languages
TypeScript
86.3%
JavaScript
8.5%
HTML
1.8%
Starlark
1.7%
CSS
1%
Other
0.6%