I have these two lists and I need that when I click on the chackmark button, the current item in the list is moved to another one of purchased items, but the most I managed to do was to make a new empty item appear in the list where the item should already appear. existing, can someone help me? My home.ts is like that
/**
* Adiciona um item
*/
addItem() {
console.log('Adicionar Item');
console.log(this.currentItem);
this.itemList.push(this.currentItem);
this.saveItemListToLocalStorage();
this.initializeEmptyItem();
}
/**
* Item concluído é movido para outra lista
*/
checkmarkItem(itemIndex: number) {
console.log('Item da lista é movido para lista de itens concluídos')
console.log(this.currentItem)
this.itemList.splice(itemIndex, 1);
this.itemListCompleted.push(this.currentItem)
this.saveItemListToLocalStorage();
this.retrieveItemListFromLocalStorage();