level 2
<input type="text" ng-model="test"/>
<ul >
<li ng-repeat="phone in phones|filter:test" ng-bind="phone.name"></li>
</ul>
在input框中输入关键字的时候都会刷新list,可不可以在输入的时候延迟0.5秒不让他刷新呢
2015年08月07日 08点08分
1
level 2
是不是通过$watch监测这个值的改变再做点什么操作?
2015年08月07日 08点08分
2
这个有呀,有一堆 示例的
2015年08月25日 14点08分
level 6
可以自定义过滤器,在过滤器中加上时间延迟!不过一般都不希望有延迟,不太明白你要延迟干什么。少用watch,非必要不要用,性能降低得很厉害!
2015年08月23日 23点08分
3
level 5
ng-model-options="{ debounce: 650 }" 用这个可以延迟 绑定的时间
2015年08月27日 08点08分
4