mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
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
|
||
|---|---|---|
| .. | ||
| bazel | ||
| contributing-stats | ||
| gulp-tasks | ||
| legacy-saucelabs | ||
| manual_api_docs | ||
| saucelabs | ||
| saucelabs-daemon | ||
| symbol-extractor | ||
| testing | ||
| tslint | ||
| BUILD.bazel | ||
| defaults.bzl | ||
| jsconfig.json | ||
| ng_benchmark.bzl | ||
| tsconfig-test.json | ||
| tsconfig.json | ||
| types.d.ts | ||