ngSwitch (directive in module ng )

Improve this doc

Description

Conditionally change the DOM structure.

Usage

This directive can be used as custom element, but be aware of IE restrictions.
<ANY ng-switch="expression">
<ANY ng-switch-when="matchValue1">...</ANY>
<ANY ng-switch-when="matchValue2">...</ANY>
...
<ANY ng-switch-default>...</ANY>
</ANY>

Directive info

  • This directive creates new scope.

Parameters

Example

Source







Demo