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
|
||
|---|---|---|
| .. | ||
| expression_parser | ||
| i18n | ||
| ml_parser | ||
| output | ||
| render3 | ||
| schema | ||
| selector | ||
| shadow_css | ||
| BUILD.bazel | ||
| compiler_facade_interface_spec.ts | ||
| integration_spec.ts | ||
| style_url_resolver_spec.ts | ||
| util_spec.ts | ||