Ways to improve AngularJS performance even with large number of DOM elements

前端 未结 6 576
自闭症患者
自闭症患者 2021-02-02 11:14

I\'m evaluating whether or not to use AngularJS for a web project, and I\'m worried about the performance for a feature I need to implement. I would like to know if there\'s a

6条回答
  •  生来不讨喜
    2021-02-02 11:22

    This is an old question now, but I think it's worth adding to the mix that Angular (since v1.3) now supports one time binding which helps slim down the digest loop. I have worked on a few applications where adding one time binding reduced the number of watches dramatically which led to improved performance. ng-repeat is often responsible for adding a lot of watches, so you could potentially consider adding one time binding to the ng-repeat.

    ng-repeat="i in ::list"
    

    Here is a summary of a few techniques that can be used to avoid adding unnecessary watches

    http://www.syntaxsuccess.com/viewarticle/547a8ba2c26c307c614c715e

提交回复
热议问题