angular/packages/compiler-cli
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
..
integrationtest refactor(compiler-cli): remove unused integration tests. (#49862) 2023-04-17 14:57:02 +00:00
linker feat(core): enable block syntax (#51994) 2023-10-03 15:26:05 -07:00
ngcc refactor(compiler-cli): add back ngcc as a no-op with a warning (#50045) 2023-04-28 18:18:40 +02:00
private refactor(compiler-cli): remove unused class decorator downlevel code (#49351) 2023-03-08 17:59:12 +00:00
src fix(compiler): forward referenced dependencies not identified as deferrable (#52017) 2023-10-04 08:57:47 -07:00
test refactor(compiler): Don't emit properties on structural ng-templates (#51950) 2023-10-04 09:00:54 -07:00
BUILD.bazel feat(compiler): initial skeleton for API doc extraction (#51733) 2023-09-18 12:29:19 +02:00
esbuild.config.js refactor: remove __ESM_IMPORT_META_URL__ workaround now that we can use ESM (#48521) 2022-12-19 19:50:41 +00:00
index.ts feat(compiler): extract docs via exports (#51828) 2023-09-20 18:34:55 +02:00
package.json feat(core): drop support for older TypeScript versions (#51792) 2023-09-19 12:04:09 +02:00
tsconfig-build.json refactor(compiler-cli): dismantle View Engine implementation of ngc (#44269) 2021-12-01 10:36:30 -08:00
tsconfig.json build: update tsconfigs to use ES2020 as target and module (#43431) 2021-10-01 18:28:42 +00:00