As a beginner in Typescript, I find the process of extracting multiple arrays from a json payload more challenging than expected. What is the best approach to tackle this? Thanks, Mike.
In this snippet of code, my goal is to isolate both Customer and records into separate arrays.
this.httpReturn = this.http.post<any>('http://localhost:8400/DynAPI/web/Qry/CustomersQry',
PostData,
{ headers: requestHeaders, observe: "response"}
).subscribe ((resp: HttpResponse<any>) => {
resp.body:
{
"RequestIO": {
"Customer": [
{
"ID": 37,
"Country": "Austria",
"Name": "Abc Mountain Bikes",
"Address": "Alttorstr. 23",
"City": "Salzburg",
"State": "West"
},
{
"ID": 1020,
"Country": "USA",
"Name": "Abc Sports II",
"Address": "3233 Pine St",
"City": "Newtown",
"State": "CA"
}
],
"Records": [
{
"Count": 2
}
]
}
}