<!DOCTYPE html> <html ng-app> <head> <meta charset="utf-8"> <title>checked</title> </head> <body> <input type="checkbox" ng-model="checked">点击试试 <div ng-if="checked">content</div> <script type="text/javascript" src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script> </body> </html>
ng-if主要用于真假值的判断