@pksquare wrote:
Hi All,
I have two ion-slide on a page. when i try to get the current index and lenth of the total slides the output is wrong. I have an array of length 3 in which 3 images are there but length is shoeing 5. The code for my both slides are as<ion-slides #firstSlide (ionSlideDidChange)="slideChanged()" autoplay="6000" speed="300" loop=true> <ion-slide *ngFor="let img of totalSlides;let i=index"> <img src={{img.ImageForMobile}} (click)="goToUrl(img.RedirectUrl,i)" > </ion-slide> </ion-slides>and for second slide
<ion-slides #secondSlides (ionSlideDidChange)="slide()" autoplay="2000" loop="false" speed="300" spaceBetween="20"> <ion-slide *ngFor="let img of secondArray;"> <img [src]="img.FilePath" alt=""> </ion-slide> </ion-slides>Ts is as
@ViewChild('firstSlide ') firstSlide : Slides; @ViewChild('secondSlides ') private secondSlides : Slides; slideChanged(){ console.log('length of bannners',this.promotionalSlides.length()); let currentIndex = this.promotionalSlides.getActiveIndex(); }when i try to find length and current index both are showing wrong. Length is showing 5 instead of 3 and current index goes upto 4 instead of 2
plaease help one slider loop is true and one slider loop is false
Posts: 1
Participants: 1