Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70850

Swiper (slideChange) doesn't work

$
0
0

Hello,
can anyone tell me why the interpolation of the index property doesn’t work? the value remains fixed at 1.

.html

<swiper (slideChange)="onSlideChange($event)">
  <ng-template *ngFor = "let image of this.images, let i = index" swiperSlide>
      <ion-list style="align-items:center">
          <ion-img class="image" [src]="image.data"></ion-img>
          <ion-label>{{image.name}}</ion-label>
       </ion-list>
  </ng-template>
</swiper>
<ion-label>{{index}}/{{this.images.length}}</ion-label>

.ts

images = [....];
index = 1;
onSlideChange(event){
    this.index = event[0].activeIndex+1;
    console.log(this.index);
}

p.s the console prints the correct index value every (slideChange)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 70850

Trending Articles



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