<ion-slides *ngIf="images !== undefined || images.length !== 0">
<ion-slide *ngFor="let image of images; let i = index">
<div class="img-wrap">
<ion-img [src]="image"></ion-img>
</div>
</ion-slide>
</ion-slides>
I have also tried the below code.
this.slides.getActiveIndex().then(index => {
let realIndex = index;
console.log(’ ggggggg ', event.target.swiper.isEnd);
if (event.target.swiper.isEnd) { // Added this code because getActiveIndex returns wrong index for last slide
realIndex = this.slidesList.length - 1;
console.log('ionSlideTouchEnd --- ', realIndex);
this.slides.slideTo(realIndex);
console.log('ionSlideTouchEnd ##### ', realIndex);
}
// You can now use real index
}).catch((error) => {
console.log(' ggggggg error ', error);
});
But getActiveIndex and isEnd Does not return anything. I am using this as a component. Please suggest.
Thanks
Alok Gupta
1 post - 1 participant