Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48976

Ion slides do not update with dynamic content

$
0
0
<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

Read full topic


Viewing all articles
Browse latest Browse all 48976

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>