Ion-slide-box active-slide problem

Hello there,

I’m using a ion-slide-box and i want to display directly a given slide using routes like /slide/:contentid and active-slide attribute.

<ion-slide-box active-slide="currentSlide" does-continue="true" auto-play="false" on-slide-changed="slideChanged($index)" show-pager="false">

When the controller initialize i don’t have yet the slide number. I’m first getting the contentid param.

$scope.contenttid = parseInt($state.params.contentid);

Then i use a service to get all contents and use a filter to find the index for setting the active slide.

    				$ = allcontent;
    				var found = null;
    				if( found = $filter('filter')($ , {id: $scope.contentid}, true) )
							$scope.slideid = $[0]);

Now, whenever i try to set $scope.currentSlide = $scope.slideid; on View events
It is either too late ( there is a slide transition from 0 to currentSlide ) or too early (and triggers an error with no line number ref to my controller code)

I’m new to Ionic/angular so i tried many things before posting here but i’m stuck :-/
Can anyone help me with this ?

have you found a solution?

Actually i’m using a different approach.
Since i have more than 100 slides with images i’m using a circular buffer (3 slides) and does-continue=“true”.

I’m not trying anymore to set the current slide when the controller loads but instead fill the buffer with the expected data at position 0 (since currentslide is 0 by default).

slide0 <-- dataitem(n)
slide1<-- dataitem(n+1)
slide2 <-- dataitem(n-1)

Then i use on-slide-changed to prepare the circular buffer for the next move according to the current move direction.
so far this works for me.