NgSwitchDefault

当没有任何 case 表达式匹配 switch 表达式的结果时,就会在父指令 NgSwitch中创建一个视图。

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

查看"说明"...

NgModule

选择器

说明

当没有任何一个 case 表达式与 switch 表达式的求值结果相同时,则插入该子树。

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

参见 NgSwitch了解详情并查看例子。

See NgSwitchfor 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>