-1
I would like to know how I recover the data coming from a Rest api, where I have an array within a Json.
Example Below:
[
{
"Presencas": [],
"Turma": {
"Alunos": [],
"Voluntarios": [],
"Id": 1,
"Nome": "Futebol Pequenos",
"IdadeMinima": 4,
"IdadeMaxima": 10,
"HorarioInicial": "08:00:00",
"HorarioFinal": "09:00:00",
"DiaSemana": "Sábado",
"QuantidadeDeAlunos": 0
},
"Id": 5,
"DataAula": "2019-01-05T00:00:00",
"DataEnvio": "2019-01-30T21:38:42",
"TurmaID": 1,
"AlunosPresentes": 0
}
]
I’m doing like this
this.rest.getAula().then((result: any[]) => {
this.aulas = result;
this.aulas.forEach(elemento => {
console.log(elemento.Id);
});
});
But the only returnees are these
"Id":5,
"DataAula":"2019-01-05T00:00:00",
"DataEnvio":"2019-01-30T21:38:42",
"TurmaID":1,
"AlunosPresentes":0
I need this information
{
"Turma": {
"Alunos": [],
"Voluntarios": [],
"Id": 1,
"Nome": "Futebol Pequenos",
"IdadeMinima": 4,
"IdadeMaxima": 10,
"HorarioInicial": "08:00:00",
"HorarioFinal": "09:00:00",
"DiaSemana": "Sábado",
"QuantidadeDeAlunos": 0
}
}
Can someone help me?
have tried
elemento[0]['Turma']
?– Victor Henrique