M
M
Mikhail Moskalev2014-07-13 18:17:15
JavaScript
Mikhail Moskalev, 2014-07-13 18:17:15

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

2 answer(s)
I
Ivan Starkov, 2014-07-13
@icelaba

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.

A
Alexey Pavlov, 2014-07-13
@joseperez

Hello. Look here . They discuss performance issues with ng-repeat

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question