ionic2: clickable ion-icon


#1

Noob question. Still figuring out ts, ng2, and ionic2.
How do I make an ion-icon clickable and then handle that event?

  <ion-item>
    <ion-input type='text' (input)='search($event, searchKey)' placeholder='type here'></ion-input>
    <ion-icon name="close-circle" item-right (<<??>>)='clearInputText($event)'></ion-icon>
  </ion-item>

#2

You can add a <button> element to achieve this:

<ion-item>
    <ion-input type='text' (input)='search($event, searchKey)' placeholder='type here'></ion-input>
    <button item-right clear (click)='clearInputText($event)'>
        <ion-icon name="close-circle"></ion-icon>
    </button>
</ion-item>