Iterating the array of objects and removing the nested object and adding in single object
Json Object:
Output:
}
res['results'].forEach((element: any, index) => {
let hospitaldetails = element.hospital_details;
let customerdetails = element.end_customer_details;
let grid = Object.assign(element, hospitaldetails, customerdetails);
this.gridData.push(grid);
});