Version: Cordova: [email protected] Ionic: 6.10.1
Error : this.slider.update is not a function
in .ts
import { ModalController, IonSlides } from "@ionic/angular";
trainingSliderOpts = {
speed: 400,
initialSlide: 0,
preloadImages: true,
allowTouchMove: false,
};
result: any;
@ViewChild("trainingSlider", { static: true }) slider: IonSlides;
ionViewDidEnter() {
this.slider.update();
}
Try to add a .then function at the end like that:
this.ionSlides.update().then(() =>
console.log('updated'))
}
If not working try the following on top of your your class:
@ViewChild('slider', {read: ElementRef})slider: ElementRef;
and then call it like this:
this.slider.nativeElement.update();