ionicSlideBoxDelegate - disable ALL swiping?

I’ve seen some similar posts on here regarding this and there is a setting for it. I’m trying to disable ALL ‘swiping’ between slides. I want to control the transition between slides by using a button in the navbar and prevent the user from swiping left/right at all.

Is this possible? I’m reading in the documentation that you can call $ionicSlideBoxDelegate.enableSlide but that doesn’t seem to be working, I can still swipe.

@mhartington, got a solution? :stuck_out_tongue:

Nevermind, you have to call $ionicSlideBoxDelegate.enableSlide(false); within the scope of the <ion-slide-box>. If you call it from a parent element or when the controller is initialized, it will not work.

how to accces the scope of the
ion-slide-box

i have done it using ng-init

@ankita91 could you include some code with your solution ? ?

If you want to disable all swiping from the controller, try this

$timeout ->
$ionicSlideBoxDelegate.enableSlide(false)
, 1

That is in coffeescript, here is the javascript version

$timeout(function() {
return $ionicSlideBoxDelegate.enableSlide(false);
}, 1);

You will need to inject $timeout.