angular/packages/core/src
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
..
change_detection refactor(ivy): Add newer, smaller NgOnChangesFeature (#28187) 2019-01-23 10:59:34 -08:00
compiler refactor: Consistently use index access on index signature types. (#28937) 2019-02-28 02:49:14 -08:00
debug refactor(ivy): split util functions into different files (#28382) 2019-02-22 13:17:30 -08:00
di docs: fix and add decorator api doc (#28986) 2019-03-04 11:47:30 -08:00
i18n docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
interface style: enforce buildifier lint on CI (#28186) 2019-02-26 16:57:41 -08:00
linker docs: add api doc to template_ref (#27380) 2019-01-22 12:13:50 -08:00
metadata docs: fix and add decorator api doc (#28986) 2019-03-04 11:47:30 -08:00
profile build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
reflection style: enforce buildifier lint on CI (#28186) 2019-02-26 16:57:41 -08:00
render fix(ivy): ensure element removal triggers host removal animations (#28162) 2019-01-17 09:58:50 -08:00
render3 fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
sanitization fix(core): traverse and sanitize content of unsafe elements (#28804) 2019-02-26 13:32:09 -08:00
testability build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
util 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
view perf(core): be more consistent about typeof checks (#28400) 2019-01-29 11:50:47 -08:00
zone docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
application_init.ts docs: update core to use @publicApi tags (#26595) 2018-10-19 14:35:53 -07:00
application_module.ts fix(ivy): use NgZone.onStable when bootstraped using PlatformRef (#27898) 2019-01-08 14:10:53 -08:00
application_ref.ts docs(core): document isStable traps (#28102) 2019-02-06 15:13:19 -05:00
application_tokens.ts docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
change_detection.ts refactor(core): remove deprecated TrackByFn (#18757) 2017-08-18 13:23:46 -05:00
codegen_private_exports.ts refactor(compiler): don’t rely on global reflector (#16832) 2017-05-23 10:41:23 -06:00
console.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
core.externs.js fix: don’t use the global ng at all with closure enhanced optimizations 2017-09-27 10:09:56 -07:00
core.ts build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
core_private_export.ts feat(ivy): implement compileComponents method for TestBedRender3 (#27778) 2019-01-15 14:08:20 -08:00
core_render3_private_export.ts fix(ivy): support property values changed in ngOnChanges (forward rref case) (#29054) 2019-03-05 14:27:08 -08:00
di.ts refactor(ivy): create Injector interface; remove dependency on Ivy (#28066) 2019-01-11 16:24:03 -08:00
error_handler.ts refactor(ivy): refactor more files in DI to prepare it for bazel packages (#28098) 2019-01-14 09:55:30 -08:00
errors.ts build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
event_emitter.ts build: move rxjs type reference to event emitter (#28720) 2019-02-19 16:28:14 -08:00
ivy_switch.ts refactor(ivy): obviate the Bazel component of the ivy_switch (#26550) 2018-10-19 09:23:05 -07:00
linker.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
metadata.ts docs: fix and add decorator api doc (#28986) 2019-03-04 11:47:30 -08:00
platform_core_providers.ts docs: convert all @experimental tags to @publicApi tags (#26595) 2018-10-19 14:35:52 -07:00
r3_symbols.ts build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
render.ts refactor(core): use flags in Renderer2.setStyle instead of booleans (#15045) 2017-03-13 09:45:04 -07:00
version.ts docs: update core to use @publicApi tags (#26595) 2018-10-19 14:35:53 -07:00
zone.ts feat(router): warn if navigation triggered outside Angular zone (#24959) 2018-09-05 09:35:14 -07:00