<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js?1.1.10"></script> </head> <body ng-app=""> HTML: <input type="checkbox" ng-model="myVar"> {{myVar}} <div ng-show="myVar"> <h1>Welcome</h1> <p>Welcome to my home.</p> </div> </body> </html>
The ng-show directive displays the specified HTML element when the expression is true, otherwise it hides the specified HTML element.
Syntax
All HTML elements support this directive.
The above is the detailed content of of-model of-show. For more information, please follow other related articles on the PHP Chinese website!