I've been attempting to separate the selected array provided by the user, but unfortunately, I'm having trouble isolating the individual elements. They are all just jumbled together.
My goal is to organize it in a format similar to the image linked below:
https://i.sstatic.net/BHS1m.png
However, what I'm currently achieving is shown in the image below:
https://i.sstatic.net/Y6xFf.png
This is the relevant part of my code from the .ts file:
sub_item: any = [{
subcat_id: "",
value: "",
qty: ""
}];
constructor(...){
..
}
submitbtn(){
this.sub_item.push({
subcat_id: this.sub_id,
qty: this.quantity,
value: this.addonId + "|" + this.addOnPrice + "|" + this.selectedAddOn
});
}
I would greatly appreciate any assistance with this issue!