AngularJSAngularjs真是个好东西

事件篇:

实例:(点击按钮内容加1)

<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<script
src=”http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"&gt;&lt;/script&gt;
</head>
<body ng-app=””>

<p>点击按钮:</p>

<button ng-click=”count = count + 1″
ng-init=”count=0″>OK</button>

<p>按钮被点击了 {{count}} 次。</p>

<p>实例中,按钮每给点击一不行变量 “count” 会自动加 1。</p>

</body>
</html>

API:

 

AngularJS 事件

AngularJS 帮助以下事件:

  • ng-click
  • ng-dbl-click
  • ng-mousedown
  • ng-mouseenter
  • ng-mouseleave
  • ng-mousemove
  • ng-keydown
  • ng-keyup
  • ng-keypress
  • ng-change

相关文章