angular-cn/tools
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
..
build build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
cjs-jasmine revert: feat(elements): implement `@angular/elements` #19469 (#20152) 2017-11-03 15:54:54 -07:00
code.angularjs.org build: use subshells when changing directories 2017-05-12 12:19:51 -07:00
gulp-tasks feat(common): add locale id parameter to `registerLocaleData` (#20623) 2017-11-27 17:00:06 -06:00
karma build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
npm build: remove local yarn (#19981) 2017-11-02 15:11:34 -07:00
public_api_guard feat(compiler): narrow types of expressions used in *ngIf (#20702) 2017-12-08 10:24:26 -08:00
source-map-test build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
travis build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
tree-shaking-test refactor: update paths from modules/@angular to packages 2017-03-08 16:29:28 -08:00
tsc-watch build: remove references to `tsc-wrapped` (#19298) 2017-09-21 13:55:52 -07:00
tslint build: update rollup lint rule from bad merge (#20047) 2017-10-30 23:43:49 -04:00
validate-commit-message revert: feat(elements): implement `@angular/elements` #19469 (#20152) 2017-11-03 15:54:54 -07:00
bazel.rc build: upgrade bazel rules to latest (#20768) 2017-12-07 11:27:50 -08:00
check-environment.js build: update npm dependencies (#19328) 2017-09-22 13:20:52 -07:00
chromedriverpatch.js refactor: add license header to JS files & format files (#12081) 2016-10-04 20:39:20 -07:00
jsconfig.json chore(vscode): add jsconfig.json and remove .settings dir 2015-10-29 13:53:21 +00:00
tsconfig.json refactor(compiler-cli): move ngc-wrapped to packages/bazel (#18733) 2017-08-23 11:34:51 -05:00
types.d.ts fix(fakeAsync): have fakeAsync use Proxy zone. (#10797) 2016-08-19 12:10:53 -07:00
utils.inc feat(bundle): add script to push bundles to code.angularjs.org 2015-04-14 14:50:53 -07:00