ng: click

【AngularJS】
ex)

<!doctype html>
<html xmlns:ng="http://angularjs.org">
<script src="http://code.angularjs.org/angular-0.9.19.min.js" ng:autobind></script>
<body>
  <button ng:click="count = count + 1" ng:init="count=0">
    Increment
  </button>
  count: {{count}}
</body>
</html>

* * *
結果:
【Increment と書かれたボタン】 count: 0

このボタンを押すと、1ずつ増えていく。

* * *
ng: click="ほにゃらら"
…このボタンを押すと起こる事

ng: init="ほにゃらら"
初期値
最終更新:2011年11月08日 10:09