angular.js performance issues

前端 未结 2 1908
面向向阳花
面向向阳花 2021-02-09 04:55

Batarang on the performance tab shows that on the app\'s root, angular is calling function that looks like that: function (a){var e,f,i=a.$eval(h),m=hc(i,.

2条回答
  •  不思量自难忘°
    2021-02-09 05:51

    Something to consider when building an Angular application where you're dynamically expanding the contents of an ngRepeat. Every ngRepeat you set up, sets up a watch. Every {{binding}} or ngModel you do inside of that repeat, sets up another watch, and so on. Each of those creates function and object instances, and also needs to be processed on every $digest. So, if your running into performance issues, you may need to implement a custom directive that writes out your data without setting up those superfluous watches, so you're a little more performant. That my 2 cents.

提交回复
热议问题