ng: bind-attr

【AngularJS】
Unlike ng:bind the ng:bind-attr contains a JSON key value pairs representing
which attributes need to be mapped to which expressions.
(ng: bind と違って、こちらはJSONの名前と値のペアとかを含むよ)

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>
  Google for:
  <input type="text" name="query" value="hoge"/>
  <a href="http://www.google.com/search?q={{query}}">Google</a>
</body>
</html>

* * *
結果:
Google for:【テキストボックス(初期値:hoge)】Google←押せる
…テキストボックスに文字列を入れて「Google」を押すとグーグル検索が出来る!
このコード量でこれはすごいね!
最終更新:2011年11月08日 14:12