Button click to move next slide

hello guys,
i am new in ionic
I have a question that is I want to go next slide using a button click instead of swiping(left-right).
any idea how to do that? please help

here is my code below,
in html:

<ion-slides pager #slidingItem>
    <ion-slide>
          <h1>Slide 1</h1>
          <button ion-button (click)="next()"> Next </button> <!-- by clicking this button I want to shift Slide 2  -->
    </ion-slide>

    <ion-slide>
         <h1>Slide 2</h1>
    </ion-slide>

    <ion-slide>
        <h1>Slide 3</h1>
    </ion-slide>
  </ion-slides>

in .ts:

next(){

}
1 Like