angular-cn/packages/compiler/test
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
..
aot feat(compiler-cli): no longer re-export external symbols by default (#28633) 2019-02-13 09:49:51 -08:00
css_parser
expression_parser
i18n refactor(compiler): use `options` argument for parsers (#28055) 2019-02-12 20:58:27 -08:00
ml_parser fix(ivy): correctly tokenize escaped characters in templates (#28978) 2019-02-28 02:44:19 -08:00
output
render3 fix(ivy): match attribute selectors for content projection with inline-templates (#29041) 2019-03-07 11:27:36 -08:00
schema
selector
template_parser fix(compiler): ensure that event handlers have the correct source spans (#28055) 2019-02-12 20:58:28 -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
compiler_facade_interface_spec.ts refactor(ivy): refactor more files in DI to prepare it for bazel packages (#28098) 2019-01-14 09:55:30 -08:00
config_spec.ts
core_spec.ts
directive_lifecycle_spec.ts
directive_normalizer_spec.ts
directive_resolver_mock_spec.ts
directive_resolver_spec.ts
integration_spec.ts
metadata_resolver_fixture.ts
metadata_resolver_spec.ts
ng_module_resolver_mock_spec.ts
ng_module_resolver_spec.ts
parse_util_spec.ts
pipe_resolver_mock_spec.ts
pipe_resolver_spec.ts
resource_loader_mock_spec.ts
runtime_compiler_spec.ts
shadow_css_spec.ts
spies.ts
style_url_resolver_spec.ts
test_bindings.ts
url_resolver_spec.ts
util_spec.ts