I receive the following json:
{
"id": "7654321212",
"lugar": "1",
"procedencia": "E",
"estado": "3",
"fecha": "20210421",
"hora": "010821",
"series": [
{
"pin": "000000",
"status": "2"
},
{
"pin": "00300",
"status": "1"
}}
In Angular I receive it in the following way, my model:
export class Muestras {
id: string;
lugar: string;
procedencia: string;
estado: string;
fecha: string;
hora: string;
series: string;
}
In the onInit:
muestras: Muestras[];
this.muestra.getMuestras().subscribe(e => {
this.embarques = e;
If the values are printed as the id, but I can't extract the value from the series array, it can only be done from the html or it has to be from typescript.
The series you receive from your json is an array, to solve the problem you must define it that way.
When you receive your information in the OnInit you assign the data of your json to your model for test mode jsonInfo is included, there you would receive from your api or service.
I leave you the example in stackblitz Demo