<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="//apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="myApp">
<div data-ng-if="false">sdfsdfsdfsd</div>
<div data-ng-if="true">22222222222222</div>
</body>
</html>
上面的第一个div不会隐藏,但是当我去掉 myApp的时候 就可以了,如下
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="//apps.bdimg.com/libs/bootstrap/3.3.4/css/bootstrap.min.css">
<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="">
<div data-ng-if="false">sdfsdfsdfsd</div>
<div data-ng-if="true">22222222222222</div>
</body>
</html>