Usage description
Ng-switch is displayed based on the value of an expression or this hides the corresponding part. Similar to the switch usage in C # or other previews. can be slowly realized.
Says Ng-switch is going to talk about how the child element should change according to the current value. A child element can be hidden or displayed by means of the: ng-switch-when instruction, Ng-switch-default instruction to set the condition to be met. It is also easy to understand when, or when, the default value. Let's look at an example below.
Example
<SelectNg-model= "Myselect"> <optionvalue= "One">Select a</option> <optionvalue= "both">Select two</option> <optionvalue= "three">Choose Three</option></Select><DivNg-switch= "Myselect"> <DivNg-switch-when= "One"> <H1>One</H1> <P>You chose one.</P> </Div> <DivNg-switch-when= "both"> <H1>Both</H1> <P>You chose both.</P> </Div> <DivNg-switch-when= "three"> <H1>Three</H1> <P>You chose three.</P> </Div></Div>
Results
[Angularjs]ng-switch Usage