I am trying to showcase the array of array data.
This is how my API has responded:
{
"product_id": "13",
"is_master": "0",
"sku": "Variable_product_15",
"upc": "",
"price": "40.00000",
"pricing_calculator": "standard",
"shipping": "0",
"params": "{\"variant_main_image\":\"images\\/themeparrot\\/clothing_products_06.png\"}",
"length": "0.00000",
"width": "0.00000",
"height": "0.00000",
}
Within this array, I specifically want to display the variant_main_image
.
This is how my ts file looks like:
variableprod() {
let j2s = this.vproductsj2sid.find(x => x.j2store_variant_id === this.vprodid);
console.log("display"+JSON.stringify(j2s));
this.vcategorydata = JSON.parse(JSON.stringify(j2s.price));
console.log(JSON.stringify("vname: "+JSON.stringify(this.vcategorydata)));
this.vpdimages = JSON.parse(JSON.stringify(j2s.params));
this.vimg = this.vpdimages.variant_main_image;
console.log(JSON.stringify("vimg: "+JSON.stringify(this.vimg)));
}
However, in the log output, it only says "vimg: undefined"