I know i can remove last item from array and first but I need to remove specified item based value Here is my array
arrayItems: { volume: number; title: string; }[]; this.arrayItems = [{ volume: 11, title: 'Title' }]; Here is my example i have html
<div *ngFor="let arrayItem of arrayItems; let i=index"> <label>{{arrayItem.i}}</label> <div (click)="removeItem(i)">remove item</div> </div> And to add and remove item
addItem() { const item = { volume: 2, title: 'Naslov 2' }; this.arrayItems.push(item); } removeItem(index) { this.arrayItems.slice(index, 1); } But to removeItem() does not work, any idea why this is wrong?
spliceand notslice.