AngularJS ng-hide
Directive
AngularJS Example
Hide a part when the checkbox is checked:
Hide HTML: <input type="checkbox" ng-model="myVar"><div
ng-hide="myVar">
<h1>Welcome</h1><p>Welcome to my home.</p></div>
Definition and Usage
The ng-hide directive hides the HTML element if the expression evaluates to true.
ng-hide is a predefined class in AngularJS that sets the element's display to none.
Syntax
Used as a CSS class:
This directive is supported by all HTML elements.
Parameter Values
Value | Description |
---|---|
expression | Hides the element if the expression returns true. |