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

#1

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

#2

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

#4

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

#5

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);
}
}
}

#6

Think about this for a bit.

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

1 Like
#7

That’s super funny :grinning: