AngularJS ng-switch Instruction
Show the corresponding section based on the selected value:
Runoob Tutorial
欢迎访问Runoob Tutorial
Google
欢迎访问Google
淘宝
欢迎访问淘宝
切换
选择不同选项显示对应的值。
Definition and Usage
ng-switch The directive shows or hides the corresponding section based on the expression.
The corresponding child elements use ng-switch-when directive. If it matches, the selected one is shown; the others that do not match are removed.
You can use ng-switch-default directive to set the default option. If nothing matches, the default option is shown.
Syntax
<
element
ng-switch=
"expression"
<
element
ng-switch-when=
"value"
<
/element
<
element
ng-switch-when=
"value"
<
/element
<
element
ng-switch-when=
"value"
<
/element
<
element
ng-switch-default
<
/element
<
/element
AngularJS Reference Manual