angular-cn/packages
Pete Bacon Darwin f535f31d78 fix(ivy): match attribute selectors for content projection with inline-templates (#29041)
The content projection mechanism is static, in that it only looks at the static
template nodes before directives are matched and change detection is run.
When you have a selector-based content projection the selection is based
on nodes that are available in the template.

For example:

```
<ng-content selector="[some-attr]"></ng-content>
```

would match

```
<div some-attr="..."></div>
```

If you have an inline-template in your projected nodes. For example:

```
<div *ngIf="..." some-attr="..."></div>
```

This gets pre-parsed and converted to a canonical form.

For example:

```
<ng-template [ngIf]="...">
  <div some-attr=".."></div>
</ng-template>
```

Note that only structural attributes (e.g. `*ngIf`) stay with the `<ng-template>`
node. The other attributes move to the contained element inside the template.

When this happens in ivy, the ng-template content is removed
from the component template function and is compiled into its own
template function. But this means that the information about the
attributes that were on the content are lost and the projection
selection mechanism is unable to match the original
`<div *ngIf="..." some-attr>`.

This commit adds support for this in ivy. Attributes are separated into three
groups (Bindings, Templates and "other"). For inline-templates the Bindings
and "other" types are hoisted back from the contained node to the `template()`
instruction, so that they can be used in content projection matching.

PR Close #29041
2019-03-07 11:27:36 -08:00
..
animations build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
bazel build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
benchpress docs: cleanup contributors (#28930) 2019-03-06 14:48:30 -08:00
common build: turn off dts bundling for packages that still are not supported (#29128) 2019-03-07 10:47:20 -08:00
compiler fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
compiler-cli fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
core fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
docs refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
elements build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
examples fix(ivy): support property values changed in ngOnChanges (forward rref case) (#29054) 2019-03-05 14:27:08 -08:00
forms build: enable bundle_dts for forms package (#28854) 2019-03-05 11:39:16 -08:00
http build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
language-service test: fix dts path to the flattened file (#28834) 2019-03-06 10:59:18 -08:00
platform-browser build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
platform-browser-dynamic build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
platform-server build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
platform-webworker build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
platform-webworker-dynamic build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
private/testing style: enforce buildifier lint on CI (#28186) 2019-02-26 16:57:41 -08:00
router build: turn off dts bundling for packages that still are not supported (#29128) 2019-03-07 10:47:20 -08:00
service-worker build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
upgrade build: remove now redundant `bundle_dts = True` attribute (#29128) 2019-03-07 10:47:20 -08:00
BUILD.bazel build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -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
goog.d.ts test(ivy): add bundling test `todo_i18n` (#27420) 2018-12-04 19:59:12 -08:00
license-banner.txt build: bump year (#27880) 2019-01-11 11:15:59 -08: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 build: update to rules_typescript 0.25.1 (#28625) 2019-02-21 07:46:21 -08:00
tsconfig-test.json build: update to rules_typescript 0.25.1 (#28625) 2019-02-21 07:46:21 -08:00
tsconfig.json ci: saucelabs-legacy job should not run schematic core tests (#29124) 2019-03-05 16:10:08 -08:00
types.d.ts build: switch to typescript's es2015 typings (#28570) 2019-02-06 14:17:55 -05: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