<<!DOCTYPE html>
<html>
<head>
<title>Angular应用</title>
<meta charset="UTF-8">
<script type="text/javascript" src="angular-1.0.1.min.js"></script>
</head>
<body ng-app="myapp" ng-controller="myctrl">
<h2>我的笔记</h2>
<textarea ng-model="message" col="40" row="10"></textarea>
<button ng-click="save()">保存</button>
<button ng-click="clear()">清空</button>
<p>剩余字数</p>{{100-message.length}}
<script type="text/javascript">
angular.module('myapp',[]).controller('myctrl',function($scope){
$scope.message="";
$scope.save=function(){alert("note saved")};
$scope.clear=function(){$scope.message="";}
});
</script>
</body>
</html>
常用命令:ng-app,ng-controller,ng-model,ng-include 常用事件ng-click 数据显示{{}},初始化一般在scope中
总结常用命令:http://www.runoob.com/angularjs/angularjs-reference.html