angular/tools/manual_api_docs/blocks
Matthieu Riegler 8bc31a515f feat(core): Allow other expression for exhaustive typechecking
When the switched expression is nested within a union, exhaustive typechecking needs to know which expression to check.
This change adds the possibility of specifying the expression to check:

```
@Component({
  selector: 'app-root',
  imports: [],
  template: `
    @switch (state.mode) {
      @case ('show') { {{ state.menu }}; }
      @case ('hide') {}
      @default never(state);
    }
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class App {
  state!: { mode: 'hide' } | { mode: 'show'; menu: number };;
}
```

fixes #67406
2026-03-24 14:42:28 -07:00
..
BUILD.bazel refactor(docs-infra): migrate api-gen from dev-infra into the repo (#57241) 2024-08-05 17:06:29 +00:00
defer.md docs: Adds @see links and update defer reference 2026-03-09 16:59:39 -07:00
for.md build: format md files 2025-11-06 10:03:05 -08:00
if.md build: format md files 2025-11-06 10:03:05 -08:00
let.md docs: fix typos in let.md (#59526) 2025-01-15 09:44:25 -05:00
switch.md feat(core): Allow other expression for exhaustive typechecking 2026-03-24 14:42:28 -07:00