$ionicSlideBoxDelegate.enableSlide(false) not working


#1

I have a multiple page app which on one page is using the ion-slides and ion-slide-page elements.

I have to add an input range control - but when dragging this - the page is move as well.

I have tried adding a directive: http://codepen.io/mhartington/pen/ImuLv using drag and touch. I can see that this directive is been called correclty but the enableSlide(false) is having no effect.

I have read that its needs to be in the actual controller - so i have added the line $ionicSlideBoxDelegate.enableSlide(false) every where - but its still not having any affect.

Where should i be placing this?

At the moment i am unable to stop the sliding from anywhere - which is really weird.

any help greatly appreciated
John


#2

I wrapped my enableSlides(false) in a $timeout and it seems to be working:

$timeout(function(){
    $ionicSlideBoxDelegate.$getByHandle('mySlider').enableSlide(false);
});

#3

Thanks, for the reply

I have placed this on the master page and on the child pages and it does not have any effect.

I’m going to have to make a tiny project and test it out.


#4

you can try increasing the timeout delay, try 100 or 300 ms and see if that works for your app.


#5

I have found that the enableSlides works with

<ion-slide-box active-slide="myActiveSlide">
    <ion-slide>
        <div class="box blue"><h1>BLUE.2..</h1></div>
    </ion-slide>
    <ion-slide>
        <div class="box yellow"><h1>YELLOW..3.</h1></div>
    </ion-slide>
    <ion-slide>
        <div class="box pink"><h1>PINK..4.</h1></div>
    </ion-slide>
</ion-slide-box>

But is there away to get it to work with ion-slides??