Dynamic Data binding

I am trying to dynamically from my TS code update the “initialSlide” value (the initial slide of the slider), but it doesn’t dynamically update. It works fine upon load with some initially set “initialSlide” value. Any advice will be highly appreciated!

    <ion-slides class="slides" pager="true" [initialSlide]="initialSlide">
      <ion-slide class="slider" *ngFor="let i of photosArray">
        <img (click)="removePhoto(i.id)" class="sliderPhoto" [src]="i.imageURI">

in my case it was due to the async pipe…
hope it works for you

in ionViewDidLoad() function.

and also define initialSlide in ionViewDidLoad() like
this.initialSlide = 1; //any other dynamic value of you choice.

1 Like

Yes, that was exactly it! I’m using move to next slide functionality with timeout instead. Thanks!

Can you please help me in implementing this in ionic 5.