AngularJS ng-show Instruction
AngularJS Examples
Show a section when the checkbox is checked:
Show HTML:
<
input
type=
"checkbox"
ng-model=
"myVar"
<
div
ng-show=
"myVar"
<
h1
Welcome
<
/h1
<
pWelcome to my home.
<
/p
<
/divTry it »
Definition and Usage
ng-show The directive shows the specified HTML element when the expression is true, otherwise it hides the specified HTML element.
Syntax
<
element
ng-show=
"expression"
<
/elementAll HTML elements support this directive.
Parameter value
| Value | Description |
|---|---|
| expression | If the expression is true, the specified HTML element is shown. |
AngularJS Reference Manual