angular-cn/goldens/public-api
Andrea Canciani 9c8bc4a239 fix(common): narrow `NgIf` context variables in template type checker (#36627)
When the `NgIf` directive is used in a template, its context variables
can be used to capture the bound value. This is sometimes used in
complex expressions, 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="enabled && user as u">{{u.name}}</span>
```

2. Binding to `NgIfContext.$implicit` using the `let` syntax:
```html
<span *ngIf="enabled && user; let u">{{u.name}}</span>
```

Because of the semantics of `ngIf`, it is known that the captured
context variable is truthy, however the template type checker
would not consider them as such and still report errors when
`strict` is enabled.

This commit updates `NgIf`'s context guard to make the types of the
context variables truthy, avoiding the issue.

Based on https://github.com/angular/angular/pull/35125

PR Close #36627
2020-07-29 10:30:44 -07:00
..
animations ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
common fix(common): narrow `NgIf` context variables in template type checker (#36627) 2020-07-29 10:30:44 -07:00
compiler-cli feat(compiler-cli): report error if undecorated class with Angular features is discovered (#36921) 2020-05-06 15:06:10 -07:00
core build: fix broken build (#38274) 2020-07-28 12:30:59 -07:00
elements ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
forms feat(forms): AbstractControl to store raw validators in addition to combined validators function (#37881) 2020-07-21 10:30:19 -07:00
localize ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
platform-browser ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
platform-browser-dynamic ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
platform-server feat(platform-server): add option for absolute URL HTTP support (#37539) 2020-06-25 14:26:09 -07:00
platform-webworker ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
platform-webworker-dynamic ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
router docs: update router api documentation (#37980) 2020-07-16 13:52:40 -07:00
service-worker feat(service-worker): include `CacheQueryOptions` options in ngsw-config (#34663) 2020-05-01 09:44:07 -07:00
upgrade ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00
manage.js ci: move public-api goldens to goldens directory (#35768) 2020-03-10 20:58:39 -04:00