angular/packages/compiler/test
Kristiyan Kostadinov 8be2c48b7c feat(core): implement new block syntax (#51891)
Switches the syntax for blocks from `{#block}{/block}` to `@block {}` based on the feedback from the community.

Read more about the decision-making process in our blog: https://blog.angular.io/meet-angulars-new-control-flow-a02c6eee7843

The existing block types changed in the following ways:

**Conditional blocks:**
```html
<!-- Before -->
{#if cond}
  Main content
  {:else if otherCond}
    Else if content
  {:else}
    Else content
{/if}

<!-- After -->
@if (cond) {
  Main content
} @else if (otherCond) {
  Else if content
} @else {
  Else content
}
```

**Deferred blocks**
```html
<!-- Before -->
{#defer when isLoaded}
  Main content
  {:loading} Loading...
  {:placeholder} <icon>pending</icon>
  {:error} Failed to load
{/defer}

<!-- After -->
@defer (when isLoaded) {
  Main content
} @loading {
  Loading...
} @placeholder {
  <icon>pending</icon>
} @error {
  Failed to load
}
```

**Switch blocks:**
```html
<!-- Before -->
{#switch value}
  {:case 1}
    One
  {:case 2}
    Two
  {:default}
    Default
{/switch}

<!-- After -->
@switch (value) {
  @case (1) {
    One
  }

  @case (2) {
    Two
  }

  @default {
    Default
  }
}
```

**For loops**
```html
<!-- Before -->
{#for item of items; track item}
  {{item.name}}
  {:empty} No items
{/for}

<!-- After -->
@for (item of items; track item) {
  {{item.name}}
} @empty {
  No items
}
```

PR Close #51891
2023-09-26 09:10:04 -07:00
..
expression_parser refactor: improve type safety of interpolation AST (#50903) 2023-07-10 07:08:28 -07:00
i18n feat(core): implement new block syntax (#51891) 2023-09-26 09:10:04 -07:00
ml_parser feat(core): implement new block syntax (#51891) 2023-09-26 09:10:04 -07:00
output test: update source-map tests to account for source-map breaking change (#46888) 2022-07-19 09:40:54 -07:00
render3 feat(core): implement new block syntax (#51891) 2023-09-26 09:10:04 -07:00
schema refactor(platform-browser): Remove BrowserDetection (#50411) 2023-05-30 13:06:28 -07:00
selector feat(compiler): allow self-closing tags on custom elements (#48535) 2023-01-04 12:07:37 -08:00
shadow_css feat(compiler): scope selectors in @scope queries (#50747) 2023-07-11 08:29:53 -07:00
BUILD.bazel build: refactor packages/compiler/test to work with ESM (#48521) 2022-12-19 19:50:42 +00:00
compiler_facade_interface_spec.ts feat(compiler): add support for compile-time required inputs (#49468) 2023-03-20 13:10:30 +01:00
integration_spec.ts refactor(platform-browser): Remove BrowserDetection (#50411) 2023-05-30 13:06:28 -07:00
security_spec.ts fix(core): hardening attribute and property binding rules for <iframe> elements (#47964) 2022-11-09 00:47:56 -08:00
style_url_resolver_spec.ts refactor(compiler): make template preparser null-safe (#44411) 2022-01-04 15:54:10 -08:00
util_spec.ts perf(compiler): use raw bytes to represent utf-8 encoded strings (#39694) 2020-11-17 10:09:28 -08:00