Can I disable swipe in SlideBox?


Hi guys, I having a draggable gmap in an ion-slide, so I want to disable the swipe event for this SlideBox(only slide by slideTo method). But I can’t find any option about that, any ideal?


Answer my own question:

    // it's empty
    // something in other slide

.gmapWarp(ng-if='slideIndex == 0')

It’s an easy hack and works fine with some css. But it’s not easy if I want .gmapWarp have slide and drag effect like other slides. Wish it have some option for that :stuck_out_tongue: .


Here is another way of doing this:

In your controller add a function:

$scope.disableSwipe = function() {

In your view add the ng-init attribute on the slide-box element

<ion-slide-box ng-init="disableSwipe()">

This will disable the slide-event.
You can now use a controller function to slide to a given index like this:

$scope.slideTo = function(index) {

e.g. use it with ng-click on a button:

<button class="button" ng-click="slideTo(0)">First</button>

Turn off draggable ion-slide

Good point of view~


Thanks! This is what I need as well :smile: