English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Display HTML
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script> </head> <body ng-app=""> Display HTML: <input type="checkbox" ng-model="myVar"> <div ng-show="myVar"> <h1>Welcome</h1> <p>Welcome to my home.</p> </div> </body> </html>Test and see ‹/›
ng-show The directive displays the specified HTML element when the expression is true, and hides the specified HTML element otherwise.
<element ng-show="expression"></element>
All HTML elements support this directive.
Value | Description |
---|---|
expression | Display the specified HTML element if the expression is true. |