Start slide at certain index


#1

Hy,

is it possible to start a ion-slide-box with a certain index? I tried it with ng-init=“initWithIndex(1)” but I guess ng-init is too early and the slider is not initialized yet.


#2

just saw there is a attribute for this directive: activeSlide
try to use ionSlideBox with active-slide="myIndex"

example:

note its zero based

old

you could set the index in the controller with

$ionicSlideBoxDelegate.slide(to, 0)

but i’m not sure if slide speed 0 does it instant.


#3

Hey Auro,

thanks for your reply,

active-slide="1"

did actually the job to start with the second slide.

I’m not very confident about loading sequence of controllers and which moment of time would be the best to make use of the controller. If it’s too late in logic the slider is loaded and the user sees it “jumping”, of its too early as it was in my case, the slider does not exist yet. If you have a certain hint about that alternative route I’d be even more happy :smiley: