Question : Ionic 2 - how to prevent page changes on ion-slides by swipe gesture?
Answered by : sefat-anam
import { Component, ViewChild } from '@angular/core';
import { Slides } from 'ionic-angular';
@Component({ selector: 'page', templateUrl: 'page.html'
})
export class Page{ @ViewChild(Slides) slides: Slides; contructor() { this.slides.lockSwipes(true); } nextSlide(){ this.slides.lockSwipes(false); this.slides.slideNext(); this.slides.lockSwipes(true); }
}
Source : https://stackoverflow.com/questions/43229873/ionic-2-how-to-prevent-page-changes-on-ion-slides-by-swipe-gesture | Last Update : Wed, 17 Nov 21