I am currently delving into Typescript and Angular, and I have encountered an issue where my view does not update when I try to modify a value in an array that is assigned to an object I defined. I have a feeling that it might be related to the context being lost here. Should I somehow execute ngZone? (I've already attempted without success). It seems like there may be a simple solution or a concept that I might be missing.
cardItems = {
addUser: true,
inventory: false
}
cardCollapseItems = [
{
label: "addUser",
item: this.cardItems.addUser
},
{
label: "inventory",
item: this.cardItems.inventory
},
collapseCard(value){
let index = this.cardCollapseItems.findIndex(item => item.label === value)
let cardItem = this.cardCollapseItems[index]
cardItem.item ? cardItem.item = false : cardItem.item = true;
}
<ion-card-header (click)="collapseCard('addUser')">
<ion-card-content [hidden]="cardItems.addUser" >