AngularJS ng-hide Directive
Definition and Usage
If the evaluation result of the expression is true,ng-hide
directive to hide HTML elements.
ng-hide
is also a predefined CSS class in AngularJS, and will hide the element's display
Set to none
.
Example
Hide part when checkbox is selected:
Hide HTML: <input type="checkbox" ng-model="myVar"> <div ng-hide="myVar"> <h1>Welcome</h1> <p>Welcome to my home.</p> </div>
Syntax
<element ng-hide="expression</element>
When used as a CSS class:
<element class="ng-hide"></element>
All HTML elements support.
Parameters
Parameters | Description |
---|---|
expression | If the expression returns true, then the expression for hiding the element is. |