How to Delete the list in ion-item sliding using delete button

How to Delete the list in ion-item sliding using delete button

can you please explain your problem better? can you post your code?

please add a snippet of code that can be usefull and format your code :slight_smile:

i want to delete the item

Home.html


<ion-item-sliding *ngFor=“let item of items”>

{{ item }}


<ion-item-option (click)=“delete()” color=“danger”>






Home.ts
delete(){
const index = this.items.indexOf(‘item’);
if (index > -1) {
this.items.splice(index, 1);
}
}
}

Think about this for a bit.

How is the delete() method supposed to have any idea what to delete?

1 Like

That’s super funny :grinning: