Ionic version: 2.x
Current behavior:
using slider.getActiveIndex() gives this error:
Error in ./Images class Images - caused by: Cannot read property ‘activeIndex’ of undefined
Expected behavior:
Without this bug i’ll be able to get the activeIndex of the active slide out of many different slides available to us in the array.
Related code:
in html file
<ion-slides #mySlider [options]="mySlideOptions" (ionDidChange)="onSlideChange()" >
<ion-slide *ngFor="let obj1 of objectList">
<img src="{{obj1.path}}">
<p>{{ "HOME.ID" | translate }}</p >
</ion-slide>
</ion-slides>
in ts file
@ViewChild('mySlider') slider: Slides;
onSlideChanged() {
this.currentIndex = this.slider.getActiveIndex() - 1;
if (this.currentIndex < 0)
this.currentIndex += 10;
this.objectIndex = this.currentIndex;
}
Error in ./Images class Images - caused by: Cannot read property 'activeIndex' of undefined Another error is: EXCEPTION: Cannot read property 'update' of undefined
i aslo posted this on ionic git issues #9837.