I’ve been playing with lists and infinite scrolling and have everything working.
I have a backend API that my infinite list requests 20 items at a time from and adds it to a scope array which the DOM list is rendered from. My question is regarding ng-repeat vs collection-repeat.
I know the documentation says that for huge lists, collection-repeat is the way to go - in fact I see that said in several posts…my problem is I am unable to see any benefit either way! My problem is that I want to have variable height items, which collection-repeat does not allow…so I am trying to convince product owners that collection-repeat is the right call for performance but unless I have some metric to show…then I cant go to bat for it!
I switch my code to use ng-repeat, and collection-repeat and scroll down the page. each new 20 items is loaded and scrolling goes on happily down the list. scrolling up is smooth regardless of the repeat method. I have tried this experiment in the browser and the simulator, i even tried profiling it using xcode (though i admin i dont really know what i am doing there) but still all the memory profiler results turn out exactly the same. So where is the benefit?!
One though I had was that perhaps the infinite scrolling negates the benefit? or that simulators are still using the desktop cpu/ram thus are smooth? I just don’t see it. i’ve infinite scrolled 2000+ items and they seem identical.
TL:DR; The documentation says collection-repeat is better for long lists…where is the proof/justification?