I'm new to Angular, I have an object that returns with some data, I want to customize the values of the data, for example the object is as per below
data.json
status: {
STATUS_ACTIVE
}
I want to convert this to "Active" instead, this object returns with multiple values such as STATUS_ACTIVE, STATUS_SUSPENDED etc...
I would appreciate your assistance in helping me achieve this using the below code, and thanks in advance.
employees.component.ts
exportAsXLSX(): void {
this.PDFvalidation().forEach(element => {
this.XLSXData.push(
{
"Status": element.status
}
)
});
this.excelService.exportAsExcelFile(this.XLSXData, 'Employees');
}
"Status": "Active"XLSXDatais a javascript object and you want the additional property at the top level of the resultant json, you should just need to doXLSXData.Status = element.status