AngularJS ng-show
Directive
AngularJS Example
Display content when a checkbox is checked:
Show HTML: <input type="checkbox" ng-model="myVar"><div
ng-show="myVar">
<h1>Welcome</h1><p>Welcome to my home.</p></div>
Definition and Usage
The ng-show directive shows the specified HTML element if the expression is true, otherwise hides the specified HTML element.
Syntax
This directive is supported by all HTML elements.
Parameter Values
Value | Description |
---|---|
expression | Displays the specified HTML element if the expression is true. |