I'm currently working with Ionic 5 / Angular and I have a collection of ion-item
's, each containing a button.
Take a look at the code snippet below:
<ion-list>
<ion-item>
<ion-label>One</ion-label>
<ion-button slot="end" (click)="selfhide()">
<ion-icon slot="icon-only" name="close-outline"></ion-icon>
</ion-button>
</ion-item>
<ion-item>
<ion-label>Two</ion-label>
<ion-button slot="end" (click)="selfhide()">
<ion-icon slot="icon-only" name="close-outline"></ion-icon>
</ion-button>
</ion-item>
<ion-item>
<ion-label>Three</ion-label>
<ion-button slot="end" (click)="selfhide()">
<ion-icon slot="icon-only" name="close-outline"></ion-icon>
</ion-button>
</ion-item>
</ion-list>
The goal is to click on any button and have the respective ion-item hide itself.
For example, clicking on the button in the first ion-item
should cause it to disappear.
What would be the best approach to achieve this functionality?