<head>
<meta charset="utf-8" />
<title></title>
<script type="text/javascript" src="js/angular.js" ></script>
<script>
//通过Angular初始化数据
</script>
</head>
<body ng-app="" ng-init="a=[100000,2,3,4];b='我是初始化的值';stu={name:'张飞',age:30};c=5;myif=true">
<input type="text" ng-model="uname" />
<p>hello {{uname}}</p>
<p>5+3={{5+3}}</p>
<p>5-3={{5-3}}</p>
<p>"qwe"+"rty"={{"qwe"+"rty"}}</p>
<p>关系运算符:5<3:{{5<3}}</p>
<p>逻辑运算符:true&&false-->{{true && false}}</p>
<p>逻辑运算符:5>3&&4>2-->{{5>3&&4>2}}</p>
<p>指令展示</p>
<p>b---->{{b}}</p>
<p>学生信息----->名字:{{stu.name}},年龄:{{stu.age}}</p>
<p>a[0]----->{{a[3]}}</p>
<p ng-bind="a[0]">通过bind得到的a[0]----->{{a[3]}}</p>
<p ng-click="c=c+1">c---->{{c}}</p>
<p>repeat展示带索引号</p>
<p ng-repeat="y in a track by $index">a数组中索引为{{$index}}的值{{y}}</p>
<p>repeat展示不带索引号</p>
<p ng-repeat="y in a ">a数组中的值{{y}}</p>
<br /><br />
<input type="checkbox" ng-model="myif" /><span ng-if="myif">显示</span>
<p ng-show="myif">复选框为打钩,显示我</p>
<p ng-hide="myif">复选框为打钩,不显示我,复选框不打钩,显示我</p>
</body>
</html>
<meta charset="utf-8" />
<title></title>
<script type="text/javascript" src="js/angular.js" ></script>
<script>
//通过Angular初始化数据
</script>
</head>
<body ng-app="" ng-init="a=[100000,2,3,4];b='我是初始化的值';stu={name:'张飞',age:30};c=5;myif=true">
<input type="text" ng-model="uname" />
<p>hello {{uname}}</p>
<p>5+3={{5+3}}</p>
<p>5-3={{5-3}}</p>
<p>"qwe"+"rty"={{"qwe"+"rty"}}</p>
<p>关系运算符:5<3:{{5<3}}</p>
<p>逻辑运算符:true&&false-->{{true && false}}</p>
<p>逻辑运算符:5>3&&4>2-->{{5>3&&4>2}}</p>
<p>指令展示</p>
<p>b---->{{b}}</p>
<p>学生信息----->名字:{{stu.name}},年龄:{{stu.age}}</p>
<p>a[0]----->{{a[3]}}</p>
<p ng-bind="a[0]">通过bind得到的a[0]----->{{a[3]}}</p>
<p ng-click="c=c+1">c---->{{c}}</p>
<p>repeat展示带索引号</p>
<p ng-repeat="y in a track by $index">a数组中索引为{{$index}}的值{{y}}</p>
<p>repeat展示不带索引号</p>
<p ng-repeat="y in a ">a数组中的值{{y}}</p>
<br /><br />
<input type="checkbox" ng-model="myif" /><span ng-if="myif">显示</span>
<p ng-show="myif">复选框为打钩,显示我</p>
<p ng-hide="myif">复选框为打钩,不显示我,复选框不打钩,显示我</p>
</body>
</html>