angular-cn/packages
Chuck Jazdzewski e7d9cb3e4c feat(compiler): narrow types of expressions used in *ngIf (#20702)
Structural directives can now specify a type guard that describes
what types can be inferred for an input expression inside the
directive's template.

NgIf was modified to declare an input guard on ngIf.

After this change, `fullTemplateTypeCheck` will infer that
usage of `ngIf` expression inside it's template is truthy.

For example, if a component has a property `person?: Person`
and a template of `<div *ngIf="person"> {{person.name}} </div>`
the compiler will no longer report that `person` might be null or
undefined.

The template compiler will generate code similar to,

```
  if (NgIf.ngIfTypeGuard(instance.person)) {
    instance.person.name
  }
```

to validate the template's use of the interpolation expression.
Calling the type guard in this fashion allows TypeScript to infer
that `person` is non-null.

Fixes: #19756?

PR Close #20702
2017-12-08 10:24:26 -08:00
..
animations refactor(core): Removed readonly getters and changed to readonly (#19842) 2017-12-08 10:24:19 -08:00
bazel build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
benchpress fix(benchpress): Allow ignoring navigationStart events in perflog metric. (#20312) 2017-11-16 16:18:38 -06:00
common feat(compiler): narrow types of expressions used in *ngIf (#20702) 2017-12-08 10:24:26 -08:00
compiler feat(compiler): narrow types of expressions used in *ngIf (#20702) 2017-12-08 10:24:26 -08:00
compiler-cli feat(compiler): narrow types of expressions used in *ngIf (#20702) 2017-12-08 10:24:26 -08:00
core feat(compiler): narrow types of expressions used in *ngIf (#20702) 2017-12-08 10:24:26 -08:00
docs refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
examples docs(common): fix mistakes in number pipe example (#20788) 2017-12-08 10:24:10 -08:00
forms feat(forms): allow nulls on setAsyncValidators (#20327) 2017-12-07 13:34:12 -08:00
http build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
language-service fix(language-service): Allow empty templates (#20651) 2017-11-29 16:52:55 -06:00
platform-browser build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
platform-browser-dynamic feat(compiler): narrow types of expressions used in *ngIf (#20702) 2017-12-08 10:24:26 -08:00
platform-server build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
platform-webworker fix: Update test code to type-check under TS 2.5 (#20175) 2017-11-15 18:12:16 -06:00
platform-webworker-dynamic refactor: make all rollup config ES5 compatible (#20028) 2017-10-30 23:09:17 -04:00
router refactor(core): Removed readonly getters and changed to readonly (#19842) 2017-12-08 10:24:19 -08:00
service-worker build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
upgrade build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
BUILD.bazel build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
README.md Revert "docs: Remove unneeded file (#18106)" 2017-07-20 16:46:47 -05:00
empty.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
es6-subset.d.ts build: switch from npm to yarn (#19328) 2017-09-22 13:20:52 -07:00
goog.d.ts fix(compiler): add typings for `COMPILED`. 2017-09-29 09:26:38 -07:00
license-banner.txt refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
rollup.config.js refactor: make all rollup config ES5 compatible (#20028) 2017-10-30 23:09:17 -04:00
system.d.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
tsconfig-build.json refactor: update angular to support TypeScript 2.4 2017-09-12 10:31:30 -07:00
tsconfig-metadata.json refactor(compiler): bump metadata version to 4 (#19338) 2017-09-26 13:31:59 -07:00
tsconfig.json build: remove references to `tsc-wrapped` (#19298) 2017-09-21 13:55:52 -07:00
types.d.ts fix: don’t use the global `ng` at all with closure enhanced optimizations 2017-09-27 10:09:56 -07:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT