Hi !
I tried to use this code of the ionic documentation, unfortunately I get nothing from ionSlideDidChange and if I try getActiveIndex() an error occurs and says that is undefined. May you help me please?
My code :
In HTML:
<ion-slides effect=“slide” (ionSlideDidChange)=“slideChanged()” [options]=“sliderOptions” #productSlider>
In TS:
@ViewChild(Slides) slides: Slides;
slideChanged() {
// Get the index of the active slide:
let index = this.slides.getActiveIndex(); // getActiveIndex is considered undefined
console.log(“Current index is” + index);
}