search

Home  >  Q&A  >  body text

angular.js - The angular ng-repeat loop array is extremely large. Will binding ng-click in the dom affect performance?

The loop array of angular ng-repeat is very large. Will binding ng-click in the dom affect the performance? For example, if the loop is looped 10,000 times, 10,000 ng-click will be bound. Is it just one binding? Ten thousand event agents?

大家讲道理大家讲道理2813 days ago597

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-05-15 16:58:40

    ng-repeat If the amount of data is particularly large, whether it is two-way binding of data or event binding, it will greatly affect the performance.

    What can be done now is: 1. Reduce unnecessary bindings. 2. Paging or other methods to reduce the amount of data loaded at one time.

    I recommend a plug-in for you Virtual Scroll for AngularJS ngRepeat directive: https://github.com/kamilkp/angular-vs-repeat

    For specific information on AngularJS performance, you can refer to these two articles
    http://angular-tips.com/blog/2013/08/removing-the-unneeded-watches/
    https://www.airpair. com/angularjs/posts/angularjs-performance-large-applications

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-15 16:58:40

    If it is too big, you can paginate it. If it is too large, it will definitely affect the performance

    reply
    0
  • Cancelreply