我一直试图弄清楚如何将list插入数组并将新数据推入同一数组。
collectionList: [any];
//Array defined
collection: [
{
Name:any,
Code:any,
Location:any,
Capacity:number,
Remaining:number
}
]
// Getting data from database in collection array to push inside arrayList
this.collection=[{
Name:item.Name,
Code:item.Code,
Location:item.Location,
Capacity:item.Capacity,
Remaining:item.Remaining
}]
//Then Pushing data to collectionList
if (item.register== true){
this.collectionList.push(this.collection)
}