Reputation: 25224
I'm currently building a slide-box with a large number of items. I've taken the code from the example outlined here for an infinite number of items, and it's working well in terms of performance.
However as I actually have a large, yet limited number of items, I would like to make the slide box stop looping once I get to the end of my collection. As the above implementation relies on a circular buffer, my go-to method would be to simply toggle the "does-continue" property on or off depending on where I am in the larger collection.
Is there a way to do this? I can't seem to locate a method on the slide box delegate which would allow such a behaviour, and it doesn't appear that I can bind a boolean expression to the does-continue attribute in the HTML either. Alternatively, is there another way to efficiently handle large, but noninfinite numbers of items in an Ionic slidebox?
Upvotes: 2
Views: 1105
Reputation: 449
I know it's been a while so I hope you solved this in the meantime. There was an updated post by travisdahl on the original thread you mentioned which I am quoting here.
UPDATE: So I was able to prevent scrolling by using
$ionicSlideBoxDelegate.$getByHandle('slideshow-slidebox')._instances[0].loop(false);
if im on the first or last slide but the trickier part is when you arrive at the slide it has to be the head (if its your lower bound) or the tail (if its your higher bound). This is more difficult than I anticipated.
Upvotes: 1