AngularJS ng-showDirective
AngularJS Example
Show partial content when checkbox is selected:
Display HTML:<input type="checkbox" ng-model="myVar">
<div ng-show="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
<div ng-show="myVar">
<h1>Welcome</h1>
<p>Welcome to my home.</p>
</div>
Try it Yourself »
Definition and Usage
ng-showThe directive displays the specified HTML element when the expression is true, otherwise hides the specified HTML element.
Syntax
<element ng-show="expression"></element>
All HTML elements support this directive.
Parameter Value
| Value | Description |
|---|---|
| expression | If the expression is true, the specified HTML element is displayed. |
Other Extensions
AngularJS Reference Manual