angular/packages/core/testing/src
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
..
async.ts feat(core): drop support for zone.js 0.10.x (#40823) 2021-02-24 07:58:29 -08:00
component_fixture.ts docs: annotate ComponentFixture.getDeferBlocks as a developer preview API (#51855) 2023-09-22 09:52:13 -07:00
defer.ts feat(core): implement new block syntax (#51891) 2023-09-26 09:10:04 -07:00
fake_async.ts docs: fix typo (#49669) 2023-04-03 19:18:40 -07:00
logger.ts refactor(core): cleanup type any (#48623) 2023-01-04 12:15:16 -08:00
metadata_override.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
metadata_overrider.ts fix(core): support cyclic metadata in TestBed overrides (#44215) 2021-11-19 19:27:08 +00:00
resolvers.ts feat(core): support TypeScript 4.8 (#47038) 2022-08-16 16:02:47 +00:00
styling.ts refactor(core): drop IE workarounds (#49763) 2023-04-13 14:01:45 +00:00
test_bed.ts refactor(core): Add defer block testing fixture (#51698) 2023-09-13 10:47:04 -07:00
test_bed_common.ts refactor(core): Add defer block testing fixture (#51698) 2023-09-13 10:47:04 -07:00
test_bed_compiler.ts refactor(core): Add defer block testing fixture (#51698) 2023-09-13 10:47:04 -07:00
test_hooks.ts fix(core): guard the jasmine hooks (#51394) 2023-08-21 08:14:53 -07:00
testing.ts refactor(core): Add defer block testing fixture (#51698) 2023-09-13 10:47:04 -07:00
testing_internal.ts refactor(core): Remove ununsed Zone mock from testing internals. (#49873) 2023-04-18 14:00:15 +00:00