Make multiple gesture buttons (tap)


#1

Hi all, sorry for my dumb question, right now im struggling with this multiple tap buttons. Below is my code so far:

in *ts file:

export class InOutPage {

public tap: number = 0;
public tap2: number = 0;

constructor(public navCtrl: NavController, public navParams: NavParams) {
}

tapEventInc(e) {
this.tap++
}

tapEventDec(e) {
this.tap–
}

tapsEventInc(e) {
this.tap2++
}

tapsEventDec(e) {
this.tap2–
}

ionViewDidLoad() {
console.log(‘ionViewDidLoad InOutPage’);
}

public event = {
month: ‘2017-01-01’,
timeStarts: ‘00:00’,
timeEnds: ‘2020-12-31’
}

}

and this is the html file:

Item In Item Out

Ruby

  <button ion-button (tap)="tapEventInc($event)">
      +
  </button>
  {{tap}}
  <button ion-button (tap)="tapEventDec($event)">
      -
  </button>
</ion-item>

Thats the summary of my coding right now, tap2 function doest work. How can I manage two gesture buttons? Because my concern is the name of tap, press, swipe and pan cant be changed since they are fixed in the ionic library. Thanks a lot.


#2

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.