Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70429

How can i move an array from a list to another

$
0
0

@xarthurdev wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70429

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>