Understanding the ngRepeat 'track by' expression

后端 未结 3 1540
醉话见心
醉话见心 2020-11-29 18:25

I\'m having difficulties understanding how the track by expression of ng-repeat in angularjs works. The documentation is very scarce: http://docs.angularjs.

3条回答
  •  情话喂你
    2020-11-29 18:45

    If you are working with objects track by the identifier(e.g. $index) instead of the whole object and you reload your data later, ngRepeat will not rebuild the DOM elements for items it has already rendered, even if the JavaScript objects in the collection have been substituted for new ones.

提交回复
热议问题