angular/packages/compiler-cli/test
Dylan Hunn 4b4dd2bf3a refactor(compiler): Don't emit properties on structural ng-templates (#51950)
Consider an `ng-template` which is generated as a result of a structural directive:

```
<div *ngFor="let inner of items"
             (click)="onClick(inner)"
             [title]="getTitle()"
             >
```

This should logically expand into something like the following:

```
<ng-template [ngForOf]="..." >
        <div (click)="..." [title]="..."></div>
</ng-template>
```

Note that the `(click)` handler and the `[title]` property are only present on the inner div, *not* on the enclosing generated `ng-template`.

Previously, Template Pipeline would place these bindings on *both* the tempate and the inner element.

However, we can't just remove them completely, because these bindings should still be matchable on the generated `ng-template` (which is very surprising, but nonetheless true).

We resolve this issue with two improvements:
(1) The ingestion step is now much smarter about determining not only if a binding is on a template element, but whether it actually targets that template element.
(2) We use `ExtractedAttributeOp` directly, rather than going through `BindingOp`, to cause the `ng-template` to still receive these bindings in its `consts` array for matching purposes.

PR Close #51950
2023-10-04 09:00:54 -07:00
..
compliance refactor(compiler): Don't emit properties on structural ng-templates (#51950) 2023-10-04 09:00:54 -07:00
ngtsc fix(compiler): forward referenced dependencies not identified as deferrable (#52017) 2023-10-04 08:57:47 -07:00
BUILD.bazel build: ensure bootstrap transitive runfiles are made available (#48521) 2022-12-19 19:50:41 +00:00
downlevel_decorators_transform_spec.ts feat(core): support TypeScript 5.2 (#51334) 2023-08-18 07:55:16 -07:00
extract_i18n_spec.ts build: switch devmode output to es2015 (#44505) 2022-01-05 23:20:20 +00:00
mocks.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
perform_compile_spec.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
perform_watch_spec.ts perf(compiler-cli): minimize filesystem calls when generating shims (#47682) 2022-10-07 09:10:34 -07:00
test_support.ts build: align with internal tsconfig options (#51728) 2023-09-12 11:39:42 -07:00
typescript_support_spec.ts fix(compiler-cli): handle pre-release versions when checking version (#44109) 2021-11-09 20:54:45 +00:00
version_helpers_spec.ts refactor(compiler-cli): move version number helpers out of diagnostics subfolder (#44269) 2021-12-01 10:36:30 -08:00