ionSlideDidChange and getActiveIndex() issues

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);
}

Update issue:

I manage to find a way to work it properly by changing (ionSlideDidChange) by (ionDrag) - (ionSlideDrag) doesn’t work for me neither.

So with (ionDrag) it resolves my issue.