I have 3 slides
but active index and length shows different number.

<ion-slides #MainSlide autoplay="5000" loop="true" (ionSlideDidChange)="mainSlideBoxChanged()">
<ion-slide *ngFor="let main of mainSlideSrc">
<img [src]="main.img">
</ion-slide>
</ion-slides>
mainSlideBoxChanged() {
this.mainSlideActiveIndex = this.mainSlides.getActiveIndex();
this.mainSlideIndexLength = this.mainSlides.length();
}
the length() method returns length + 2
the getActiveIndex() method returns actual index + 1
Adds
From the chrome dev tool, i noticed there are 5 <ion-slides>
The first slide is the last element of the 3 slides.
The last slide is the first element of the 3 slides.
In between 1st and last is the actual 3 slides.
I guess Ionic automatically adds these slides at front and back.
How can I fix this??