I am building an app with the ion-slide-box and I wanted to know if there is a way to essentially have an infinite slide box. I dynamically add new slides and then do
but the problem is that it keeps all the old slides so eventually there will be too many to keep in memory. Ideally I would be able to remove slides as well without affecting which slide the user is currently looking at. Essentially I want to be able to do something like this:
$ionicSlideBoxDelegate.enableSlide(false); var current = $ionicSlideBoxDelegate.currentIndex(); // remove first slide (this I can handle w/o changes in ionic) // add new slide at the end (again, something I can handle) // set current index to be current - 1 (this is the issue; no API in ionic) $ionicSlideBoxDelegate.update(); $ionicSlideBoxDelegate.enableSlide(true);
Of course, it would be even better if the $ionicSlideBoxDelegate had an API for adding/removing slides, but the easier thing for the short term is just to expose a way to set the current index without any other changes so that I can add/remove slides dynamically and it won’t affect what the user is currently looking at.