This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

NgSwitchDefault

Creates a view that is added to the parent NgSwitch when no case expressions match the switch expression.

See more...

NgModule

Selectors

Description

Insert the sub-tree when no case expressions evaluate to the same value as the enclosing switch expression.

See NgSwitch for more details and example.

<container-element [ngSwitch]="switch_expression"> <some-element *ngSwitchCase="match_expression_1">...</some-element> <some-other-element *ngSwitchDefault>...</some-other-element> </container-element>
      
      <container-element [ngSwitch]="switch_expression">
  <some-element *ngSwitchCase="match_expression_1">...</some-element>
  <some-other-element *ngSwitchDefault>...</some-other-element>
</container-element>