
Currently the `ngForOf` input accepts `null` or `undefined` as valid values. Although when using strict template input type checking (which will be supported by `ngtsc`), passing `null` or `undefined` with strict null checks enabled causes a type check failure because the type for the `ngForOf` input becomes too strict if strict null checks are enabled. The type of the input needs to be expanded to also accept `null` or `undefined` to behave consistently regardless of the `strictNullChecks` flag. This is necessary because whenever strict input type checking is enabled by default, most of the Angular projects that use `*ngFor` with the async pipe will either need to disable template type checking or strict null checks because the `async` pipe returns `null` if the observable hasn't been emitted yet. See for example how this affects the `angular/components` repository and how much bloat the workaround involves: https://github.com/angular/components/pull/16373/files#r296942696. PR Close #31371
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%