Slide box and collection-repeat

I’ve got quite a few heavy slides in the slide box. I would love to take advantage of collection-repeat directive to minimize the performance penalty.

Has anyone tried it?

I cannot image Ionic team not planning to have this feature on the radar. I am sure that many folks would love to see it, and because Ionic is all about performance, this is a must.

I can’t speak for the team, but I can say that performance is the shared responsibility of both Ionic and developers.

I’ve seen several examples of people using the slide box with LOTS of slides, and some complain of performance problems. The issue is, what exactly is causing poor performance? Images loaded over a network connection would be extremely slow compared to loading images from the device’s photo library, which could cause the delay. Using collection repeat on a slide box might not work well, because of the way collection repeat needs to behave, particularly regarding its item size requirements.

I would recommend just using collection repeat and ionScroll (using paging) to create the same effect, without the slidebox. I don’t have an example of this exactly with collection repeat, but here is a sample of using ionScroll. This might get you started in the right direction.

Thanks for the input! I have implemented your suggestion, it worked! However, the performance is not acceptable now at all. The whole scroll is very laggy, in slider all animation were much smoother and felt more native.

To make it clear, I do not have any images in my slider, purely text and css. The truth is, I would like to have maximum 3 items in DOM loaded by the slider and manipulate the array dynamically. I’ve been trying to complete it in the controller but only manage to add items dynamically without affecting the slide box. As soon as I start shifting items from the beginning, slider stops loading more items…

Ionic team?

Maybe this will give you an idea:

Zarko, thanks for coming by! The link you provided is not working, I think you gave a wrong one as I went to the initial thread from your reference and found the working version! That looks really good, thanks!

This is the right CodePen

See the Pen Ionic b14 - Infinite Generated Slides by Zarko Hristovski (@zarko) on CodePen.

1 Like