求助,angularjs延迟过滤
angularjs吧
全部回复
仅看楼主
level 2
yuseeing 楼主
<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
yuseeing 楼主
是不是通过$watch监测这个值的改变再做点什么操作?
2015年08月07日 08点08分 2
这个有呀,有一堆 示例的
2015年08月25日 14点08分
http://developer.51cto.com/art/201311/416334.htm,这里面有个,第六节的第一页或者第二页来着。
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
1