jeudi 9 février 2017

Ionic 2 button in slider

Vote count: 0

I have a basic slider in Ionic 2

<ion-slides>
  <ion-slide>
    <h1>Slide 1</h1>
    <button (click)="doAction()">Click me</button>
  </ion-slide>
  <ion-slide>
    <h1>Slide 2</h1>
  </ion-slide>
  <ion-slide>
    <h1>Slide 3</h1>
  </ion-slide>
</ion-slides>

And in my ts file

doAction() {
  console.log("clicked");
}

Clicking the button does nothing. If I place the button anywhere outside the slider it works fine. Is the slider capturing the click event somehow?

asked 37 secs ago

Let's block ads! (Why?)



Ionic 2 button in slider

Aucun commentaire:

Enregistrer un commentaire