AngularJS ng-hide directive
AngularJS instance
Hide a part when check box is selected:
<!DOCTYPE html><html><head><meta charset="utf-8"><script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script></head><body ng-app="">Hide HTML: <input type="checkbox" ng-model="myVar"><div ng-hide="myVar"><h1>Welcome</h1><p>Welcome to my home.</p></div></body></html>
Definition and usage
The ng-hide directive hides HTML elements when the expression is true.
ng-hide is a predefined class of AngularJS, setting the display of the element to none.
grammar
<element ng-hide="expression"></element>
Use as a CSS class:
<element></element>
All HTML elements support this directive.
Parameter value
| value | describe |
|---|---|
| Expression | The expression hides the element if it returns true. |
The above is the basic knowledge of AngularJS ng-hide directive, and will be added later.