angular-cn/tools
JoostK 40039d8068 fix(ivy): narrow `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
2020-02-28 07:39:57 -08:00
..
brotli-cli build: switch to @build_bazel_rules_nodejs//:index.bzl load point (#33433) 2019-10-28 10:10:48 -07:00
browsers build: fixes for cross-platform RBE (#33708) 2019-11-15 10:49:55 -08:00
build build: remove obsolete build related tools and helper scripts (#34058) 2019-12-02 10:52:21 -08:00
circular_dependency_test build: create bazel marco to test for circular dependencies (#34774) 2020-01-23 11:36:40 -08:00
gulp-tasks ci: properly validate commit messages locally (#35035) 2020-02-04 10:25:01 -08:00
ng_rollup_bundle build: should use $(execpath) in npm_package_bin args (#34736) 2020-01-15 14:58:07 -05:00
ngcontainer build: use bazel version from node modules (#26691) 2018-10-30 16:19:13 -04:00
npm style: add file header (#28871) 2019-02-28 12:06:36 -08:00
npm_integration_test build: add npm package manifest to npm_integration_test (#35669) 2020-02-26 12:58:35 -08:00
public_api_guard fix(ivy): narrow `NgIf` context variables in template type checker (#35125) 2020-02-28 07:39:57 -08:00
pullapprove ci: add verification of the pullapprove config (#35060) 2020-02-12 16:39:13 -08:00
rxjs build: update to rules_nodejs 0.32.2 (#31325) 2019-07-01 14:16:42 -07:00
saucelabs build: polish up bazel karma saucelabs info tools/saucelabs/README.md (#35667) 2020-02-26 12:58:14 -08:00
size-tracking build: update scripting and tooling to rely on define=angular_ivy_enabled instream of define=compile (#33983) 2019-11-26 16:38:40 -05:00
source-map-test build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
symbol-extractor build: update scripting and tooling to rely on define=angular_ivy_enabled instream of define=compile (#33983) 2019-11-26 16:38:40 -05:00
testing build: update to rules_nodejs 1.1.0 (#34736) 2020-01-15 14:58:07 -05:00
ts-api-guardian build: allow auto-discover all typings files in npm package by ts-api-guardian (#35691) 2020-02-27 14:02:16 -08:00
tslint build: remove unused rollup.config.js files (#28646) 2019-02-14 19:28:08 +00:00
utils ci: only lint commit messages in the PR (#35035) 2020-02-04 10:25:01 -08:00
validate-commit-message test: add 'localize' as an allowed commit message scope (#34974) 2020-01-26 14:53:47 -08:00
yarn build: upgrade yarn to 1.3.2 (#21406) 2018-01-10 12:32:26 -08:00
BUILD.bazel build: enable network for docker on remote executors (#35432) 2020-02-14 15:33:37 -08:00
bazel_stamp_vars.js build: add pre-release check that validates the version name (#29551) 2019-03-27 12:26:13 -07:00
check-environment.js build: update to Node 10 (#25822) 2018-09-06 14:58:30 -07:00
defaults.bzl test: saucelab targets for all karma tests (#35516) 2020-02-24 17:27:21 -08:00
jasmine-seed-generator.js test: run unit tests in random order (#19904) 2018-07-06 13:48:02 -07:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
ng_benchmark.bzl ci: do not run ng_benchmarks on CI (#34057) 2019-11-26 16:10:09 -08:00
postinstall-patches.js build: delete rxjs d.ts files referencing rxjs-compat (#33786) 2019-11-13 13:33:05 -08:00
rebase-pr.js ci: only lint commit messages in the PR (#35035) 2020-02-04 10:25:01 -08:00
tsconfig-test.json build(bazel): use fine-grained npm deps (#26111) (#26488) 2018-10-19 20:59:29 -07:00
tsconfig.json build: ts-api-guardian tsconfig warning with bazel (#27583) 2018-12-13 11:01:48 -08:00
types.d.ts build(bazel): use bazel managed node_modules for downstream angular from source build support (#24663) 2018-07-26 17:02:21 -07:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00