5de5b52beb
In Ivy's template type checker, event bindings are checked in a closure to allow for accurate type inference of the `$event` parameter. Because of the closure, any narrowing effects of template guards will no longer be in effect when checking the event binding, as TypeScript assumes that the guard outside of the closure may no longer be true once the closure is invoked. For more information on TypeScript's Control Flow Analysis, please refer to https://github.com/microsoft/TypeScript/issues/9998. In Angular templates, it is known that an event binding can only be executed when the view it occurs in is currently rendered, hence the corresponding template guard is known to hold during the invocation of an event handler closure. As such, it is desirable that any narrowing effects from template guards are still in effect within the event handler closure. This commit tweaks the generated Type-Check Block (TCB) to repeat all template guards within an event handler closure. This achieves the narrowing effect of the guards even within the closure. Fixes #35073 PR Close #35193 |
||
---|---|---|
.. | ||
animations | ||
bazel | ||
benchpress | ||
common | ||
compiler | ||
compiler-cli | ||
core | ||
docs | ||
elements | ||
examples | ||
forms | ||
http | ||
language-service | ||
localize | ||
platform-browser | ||
platform-browser-dynamic | ||
platform-server | ||
platform-webworker | ||
platform-webworker-dynamic | ||
private/testing | ||
router | ||
service-worker | ||
upgrade | ||
zone.js | ||
BUILD.bazel | ||
README.md | ||
empty.ts | ||
goog.d.ts | ||
license-banner.txt | ||
system.d.ts | ||
tsconfig-build-no-strict.json | ||
tsconfig-build.json | ||
tsconfig-test.json | ||
tsconfig.json | ||
types.d.ts |
README.md
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT