I am using deckgrid in conjunction with a custom built infinite scroller to load a continuous stream of photos in Angular laid out in a masonry layout. The data set returned each time is quite large and I had noticed that deckgrid calls quick-ng-repeat on the data set to generate the cards. Deckgrid also places a watchCollection on the data set so when the data set changes (triggered by appending data to the data set when user scrolls to the bottom), the ng-repeat will re render everything in the data set (old and new data alike).
Unfortunately, re rendering each card is extremely expensive given the size of the data set and other post processing that my application has to do. I want to be able to leave the already rendered cards as is and only render new cards with the newly fetched data. In other words is there a way for ng-repeat to un bind on elements that have already been rendered?
We had to add track by $index to the deckgrid directive. This rendered only the new DOM elements.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments