<!doctype html>
<html ng-app="myApp">
<head>
<script src="http://cdn.bootcss.com/angular.js/1.3.12/angular.min.js"></script>
<script src="http://cdn.bootcss.com/angular-i18n/1.2.15/angular-locale_zh-cn.js"></script>
</head>
<body>
<label>someProperty = {{someProperty}}</label>
<input type="checkbox"
ng-checked="someProperty"
ng-init="someProperty = true"
ng-model="someProperty">
<hr/>
<label>Select Two Fish:</label>
<input type="checkbox"
ng-model="isTwoFish"><br/>
<select>
<option>One Fish</option>
<option ng-selected="isTwoFish">Two Fish</option>
</select>
<script>
angular.module('myApp', [])
</script>
</body>
</html>
代码来自于《AngularJS权威教程》P58
本人收集整理一下,记录笔记,有兴趣的,给分享下。
打开:http://jsbin.com/diqoyobulo/1/edit
把本段代放进去,运行即可看见效果。