I created a function in which when the user gives a simple click in the item, it shows a Toast
, an alert, on the screen with the name of this item:
Function in my file .ts
:
itemSelected(item: string) {
this.toastCtrl.showToast("Selected Item: " + item, 'bottom');
}
Now the button is set this way:
<button ion-item *ngFor="let item of people" (click)="itemSelected(item)">
{{ item.firstname }}
</button>
This works normally, however now I would like to create a list of options when the user makes a long click on the item. On native Android it is possible to do this using the setOnItemLongClickListener
method, but I do not know what the equivalent in Ionic would be. What method equivalent to setOnItemLongClickListener
in Ionic 2?