<!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
把本段代放进去,运行即可看见效果。
本文展示了AngularJS在创建交互式Web应用中如何实现简单的表单验证与动态数据展示,通过HTML模板结合JavaScript逻辑,实现用户界面与后台数据的无缝对接。
2142

被折叠的 条评论
为什么被折叠?



