angular.js - angular ng-repeat循环数组特别大,dom中绑定ng-click,会不会影响性能
大家讲道理
大家讲道理 2017-05-15 16:56:40
0
2
496

angular ng-repeat循环数组特别大,dom中绑定ng-click,会不会影响性能, 比如循环一万次,就会绑定一万个ng-click ,是不是就绑定了一万个事件代理啊?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all (2)
滿天的星座

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

    習慣沉默

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

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!