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

NgSwitchCase

Creates a view that will be added/removed from the parent NgSwitch when the given expression evaluate to respectively the same/different value as the switch expression.

See more...

NgModule

Selectors

Properties

Property Description
@Input()
ngSwitchCase: any

Description

Insert the sub-tree when the expression evaluates to the same value as the enclosing switch expression.

If multiple match expressions match the switch expression value, all of them are displayed.

See NgSwitch for more details and example.

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

Methods

ngDoCheck()
      
      ngDoCheck()
    

Parameters

There are no parameters.