Slidebox : go to an index between controllers


#1

Hi,

I can go to an index inside a slidebox with : $ionicSlideBoxDelegate.slide(index)

but, is there a way to pass this information outside the slidebox ? look at the user template

push “Skip intro”, now, i want to go to slide 2 when pushing "Do Tutorial Again"
is it possible ?

thank you


#2

Not sure if this is the most optimal solution but I’d create a custom service to store the information as to what slide index to display. The $ionicSlideBoxDelegate has a slide() method but you won’t be able to call that from another controller (MainCtrl). You’d have to call that from your IntroCtrl. Hope that helps


#3

is it possible to add it to a codepen ?
I’m still learning then its hard to understand the concept :smile:

thank you


#4

Sure. I added a service in this codepen to track the index and then synced the slide box index with the service using active-slide attribute. I also changed the Ionic build to the latest stable builds as opposed to the nightly builds. The code still needs some refactoring but I hope this helps.


#5

that’s exactly what i was looking for !
than you for your time !