As a newcomer to Typescript, I am eager to work with JSON and access its objects and attributes. However, I am encountering difficulties in achieving this. I have attempted using functions like 'for of' and 'for in', but unfortunately, I have not been successful in accessing the attribute of pavilions contained within. My programming skills are still developing, so any assistance you could provide would be greatly appreciated.
for (let p in this.pabellon) {
let i = p
console.log(this.pabellon[p])
for (let pab of this.pabellon) {
pab.pabellones[i]
}
}
"sectorCenter": {
/// ......
},
"sectorPoly": [
///......
],
"pabellones": [
{ // Pabellon 1
"id": 1,
"properties": [
/// .......
],
"coordsPoly": [
///.....
],
"centerCoordsPab": {
///.....
},
"sitioCarga": [
///....
],
"silos": [
/// ....
]
},
It currently returns either 'undefined' or nothing.