发布于 2014-03-12 11:17:25
文档中有一个提示:
Now this example uses 0 watches per person and renders exactly the same result as the above that uses ng-. *(Angular still uses 1 watcher for ngRepeatWatch)
关键是角仍然保持对ngRepeat的监视,所以如果数组发生变化,ngRepeat将重新呈现数组并重新应用bindonce功能。
我更新了您的这里的jsbin示例以更好地说明这个http://jsbin.com/xugemico/2/edit
请注意以下添加内容:
<p>
Bindonce: first item:
<span bindonce="arr" bo-bind="arr[0]"></span>
</p>上面的代码在第一个数组项上使用bindonce,而不使用ngRepeat的手表,您将看到该值没有按照ngRepeat中的绑定更新。
https://stackoverflow.com/questions/22280924
复制相似问题