AngularJS ng-show directive
AngularJS instance
Some contents are displayed when the 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="">Show HTML: <input type="checkbox" ng-model="myVar"><div ng-show="myVar"><h1>Welcome</h1><p>Welcome to my home.</p></div></body></html>
Definition and usage
The ng-show directive displays the specified HTML element when the expression is true, otherwise hides the specified HTML element.
grammar
<element ng-show="expression"></element>
All HTML elements support this directive.
Parameter value
| value | describe |
|---|---|
| Expression | If the expression is true, the specified HTML element is displayed. |
The above is a compilation of the basic information of the AngularJS ng-show instruction, and the relevant information will be added in the future.