Response Data:
[
{
"professionalId": {
"cib_code": "30003",
"thirdPartyId": "RS30004"
},
"nationalIdentifier": "984538926",
"nationalIdType": "SIREN"
},
{
"professionalId": {
"cib_code": "30003",
"thirdPartyId": "RS30008"
},
"nationalIdentifier": "944316926",
"nationalIdType": "SIREN"
}
]
Using REST call to fetch JSON response from the database:
this.thirdpartyServices.getThirdparties().subscribe(data=>this.thirdpartyapis$=data);
The above JSON array response is stored in the **thirdpartyapis**
object
I need another object with a simplified format like:
[
{
"cib_code": "30003",
"thirdPartyId": "RS30004"
"nationalIdentifier": "984538926",
"nationalIdType": "SIREN"
},
{
"cib_code": "30003",
"thirdPartyId": "RS30008"
"nationalIdentifier": "944316926",
"nationalIdType": "SIREN"
}
]
I want to map my data in TypeScript so that I can use the same object in HTML to display data in a grid table. Please suggest how to achieve this in Angular 2 with TypeScript.