On doing swipe lock I am getting an error.
updateSlideBox() {
var slideController = document.querySelector(".slidernow");
slideController.componentOnReady().then(function () {
slideController.update();
slideController. lockSwipes();
});
}
jepizrms.js:5 Uncaught (in promise) TypeError: this.swiper.unlockSwipeToNext is not a function
at k.lockSwipeToNext (jepizrms.js:5)
at eval (Airport.js?3dca:146)
I can tell slideTo is working fine but locking swipes of slides is throwing error.
Ionic version:
I confirm. I have the same issue with lockSwipes (using beta 7)
Uncaught (in promise): TypeError: this.swiper.unlockSwipes is not a function
TypeError: this.swiper.unlockSwipes is not a function
LockSwipes() isn't working but I found a workaround.
You have to disable swiping from the 'Sliders' options. There are a couple of ways of doing it (check Swiper Docs) but this is how I did it:
HTML:
<ion-slides [options]="slideOpts"></ion-slides>
TS:
slideOpts: any = {allowTouchMove: false};
LockSwipes( lock: boolean ){
if (lock == true){
this.slideOpts = {allowTouchMove: true};
}else{
this.slideOpts = {allowTouchMove: false};
}
}
With this code simply call the function LockSwipes and you are ready to go. :)
This is issue should be resolved in beta.17. If I am wrong, please write here!
Still not working in beta.17, using the allowTouchMove: false in the options instead.
My code:
ngAfterContentInit() {
this.slides = document.querySelector('ion-slides');
this.slides.lockSwipes();
}
@synga thanks for your response :) I tested it again and it works like expected. Please see the following gif (my repo https://github.com/paulstelzer/test-ionic ). As you can see, lockswipes is working.
If it's still not working for you, please add a repo, so we can check it :)

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
LockSwipes() isn't working but I found a workaround.
You have to disable swiping from the 'Sliders' options. There are a couple of ways of doing it (check Swiper Docs) but this is how I did it:
HTML:
TS:
With this code simply call the function LockSwipes and you are ready to go. :)