angular-cn/packages/core/test/render3
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
..
ivy style: enforce buildifier lint on CI (#28186) 2019-02-26 16:57:41 -08:00
jit fix(ivy): support static ViewChild queries (#28811) 2019-02-19 15:29:00 -08:00
styling fix(ivy): ensure static styling is properly inherited into child components (#29015) 2019-03-04 13:36:19 -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
basic_perf.ts refactor(ivy): generate vars in component defs (#25562) 2018-08-20 11:08:10 -07:00
change_detection_spec.ts fix(ivy): mark views dirty by default when events fire (#28474) 2019-02-01 15:48:06 -05:00
common_integration_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
common_with_def.ts fix(ivy): NgOnChangesFeature no longer included in hello_world (#28187) 2019-01-23 10:59:34 -08:00
component_ref_spec.ts fix(ivy): pass ngContentSelectors through to `defineComponent()` calls (#27867) 2019-01-10 13:36:37 -08:00
component_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
content_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
control_flow_spec.ts fix(ivy): process creation mode deeply before running update mode (#27744) 2018-12-19 15:10:16 -05:00
debug_spec.ts ci(core): fix `legacy-unit-tests-saucelabs` job (#29009) 2019-02-27 10:32:40 -08:00
di_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
directive_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
discovery_utils_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
domino.d.ts feat(core): Moving Renderer3 into @angular/core (#20855) 2017-12-21 21:40:58 -08:00
exports_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
global_utils_spec.ts refactor(ivy): split util functions into different files (#28382) 2019-02-22 13:17:30 -08:00
host_binding_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
i18n_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
imported_renderer2.ts refactor(ivy): misc cleanup (#25369) 2018-08-14 11:58:47 -07:00
inherit_definition_feature_spec.ts refactor: rename `AttributeMarker.ProjectOnly` to `AttributeMarker.Bindings` (#29041) 2019-03-07 11:27:35 -08:00
instructions_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
integration_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
jit_environment_spec.ts fix(ivy): remove metadata from *Def and introduce *DefWithMeta types (#26203) 2018-10-04 10:11:17 -07:00
lifecycle_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
listeners_spec.ts fix(ivy): adding event listeners for global objects (window, document, body) (#27772) 2019-01-08 10:33:17 -08:00
load_domino.ts fix(core): Remove static dependency from @angular/core to @angular/compiler (#26734) 2018-10-31 14:15:06 -04:00
metadata_spec.ts build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
node_selector_matcher_spec.ts refactor: rename `AttributeMarker.ProjectOnly` to `AttributeMarker.Bindings` (#29041) 2019-03-07 11:27:35 -08:00
outputs_spec.ts build: move rxjs type reference to event emitter (#28720) 2019-02-19 16:28:14 -08:00
perfCounter_spec.ts build: extract interface and util sub compilation from core (#28028) 2019-01-10 16:31:44 -08:00
pipe_spec.ts fix(ivy): throw on bindings to unknown properties (#28537) 2019-02-07 12:37:32 -08:00
properties_spec.ts fixup! fix(ivy): incorrectly remapping certain properties that refer to inputs (#28765) 2019-02-21 17:59:50 -08:00
providers_spec.ts refactor(ivy): split util functions into different files (#28382) 2019-02-22 13:17:30 -08:00
pure_function_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
query_spec.ts fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
render_util.ts refactor(ivy): split util functions into different files (#28382) 2019-02-22 13:17:30 -08:00
renderer_factory_spec.ts fix(ivy): don't create TNodes for native projectable nodes (#28275) 2019-01-23 10:56:09 -08:00
template_ref_spec.ts refactor: rename `AttributeMarker.ProjectOnly` to `AttributeMarker.Bindings` (#29041) 2019-03-07 11:27:35 -08:00
testing_spec.ts refactor(core): remove withBody from public testing API (#25171) 2018-07-31 15:09:32 -07:00
util_spec.ts refactor(ivy): split util functions into different files (#28382) 2019-02-22 13:17:30 -08:00
view_container_ref_spec.ts refactor: rename `AttributeMarker.ProjectOnly` to `AttributeMarker.Bindings` (#29041) 2019-03-07 11:27:35 -08:00
view_utils_spec.ts refactor(ivy): simplify differentiation of LView, `RNode`, `LView`, `LContainer`, `StylingContext` (#28947) 2019-02-26 02:01:07 +00:00