angular.js - AngularJS点击搜索,实现数据变化,不通过重新请求接口的方法
滿天的星座
滿天的星座 2017-05-15 17:09:18
0
2
490

1.页面如下:

2.文本框输入内容,点击搜索ICON,可以过滤下面的列表。

滿天的星座
滿天的星座

reply all(2)
Ty80

Unless you request all the data at once and use filter to filter, it can be implemented without re-requesting and without clicking, but this will cause too much data to be downloaded at one time.

Peter_Zhu

ng-repeat="obj in objs | filter: test"

The test here uses ng-model to bind the value of the search box above, which can achieve the effect you mentioned. The built-in filter is real-time filtering. As long as you enter it, it will automatically help you find the corresponding data

But in a real production environment, when there is a lot of data, this filtering method is not suitable.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template