Skip to content

Add an error message when ngSwitchDefault is surrounded by ngIf  #47578

@turanofff

Description

@turanofff

Which @angular/* package(s) are the source of the bug?

common

Is this a regression?

No

Description

In situations where *ngIf is wrapping *ngSwitchCase and *ngSwitchDefault, when *ngIf condition changes *ngSwitchDefault seems to be responding to the change only once, whereas *ngSwitchCase works as expected and is hiding/showing elements any number of times.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/angular-ivy-gr6cbt?file=src%2Fapp%2Fapp.component.html

Please provide the exception or error you saw

N/A

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 14.0.7
Node: 14.20.0
Package Manager: npm 6.14.17 
OS: darwin x64

Angular: 14.2.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1402.3
@angular-devkit/build-angular   14.2.3
@angular-devkit/core            14.2.3
@angular-devkit/schematics      14.0.7
@angular/cli                    14.0.7
@schematics/angular             14.0.7
rxjs                            7.5.7
typescript                      4.7.4

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: commonIssues related to APIs in the @angular/common packagehotlist: error messages

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions