home.html
<div (tap)="itemTapped($event)" (press)="itemPressed($event)" style="width: 200px; height: 100px; background: gray">tap or press me</div>
home.ts
itemTapped(e) {
console.log("itemTapped");
alert("itemTapped");
}
itemPressed(e) {
console.log("itemPressed");
alert("itemPressed");
}
I click the element of div, alert(“itemTapped”); will run , and (press) event will trigger after close the pop alert
but if you close alert quickly enough, press event will not be triggered.
or if commit alert(“itemTapped”); press event will not be triggered.
now, i want to click the item to push a detail page, and don’t triger press event