Answer the question
In order to leave comments, you need to log in
How can I make ngRepet only redraw changed elements?
Good afternoon!
It is necessary to make a list with an infinite scroll. I made a service for loading new data via $resource, but ran into the problem of rendering this data. Namely, the problem with ngRepeat. When adding new elements to the array, it redraws ALL DOM elements of the array again, so all directives in this list are initialized each time the list changes.
Maybe someone has already encountered a similar problem and knows how to make sure that ngRepeat does not redraw already added elements?
Answer the question
In order to leave comments, you need to log in
It does NOT redraw all array elements if you push.
It is enough to look at the relatively simple code of the directive, where most of the code is just devoted to checking whether an element has already been in the array.
Hello. Look here . They discuss performance issues with ng-repeat
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question