I'm having a hard time understanding how the splice () method works. I need to delete items from an array, when I click on (x), eg:
<ion-item *ngFor="let item of data">
<ion-grid>
<ion-row>
<ion-col width-50>
{{item.nameFruit}}
</ion-col>
<ion-col width-50 text-right (click)="delItem(item)">
X
</ion-col>
</ion-row>
</ion-grid>
</ion-item>
Typescript:
delItem(id){
let elemento = this.data.splice(0,id);
}