search

Home  >  Q&A  >  body text

angular.js - AngularJS click search to implement data changes without re-requesting the interface method

1. The page is as follows:

2. Enter content in the text box and click Search ICON to filter the list below.

滿天的星座滿天的星座2783 days ago527

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-15 17:11:18

    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.

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-15 17:11:18

    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.

    reply
    0
  • Cancelreply