angular.js - The angular ng-repeat loop array is extremely large. Will binding ng-click in the dom affect performance?
大家讲道理2017-05-15 16:56:40
0
2
587
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?
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
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