I have this Nested json that i am getting from my service get call
{
"id": "7979d0c78074638bbdf739ffdf285c7e1c74a691",
"seatbid": [{
"bid": [{
"id": "C1X1486125445685",
"impid": "12345",
"price": 0,
"adm": {
"native": {
"link": {
"url": "http: //i.am.a/URL"
},
"assets": [{
"id": "001",
"required": 1,
"title": {
"text": "Learn about this awesome thing"
}
}],
"imptrackers": ["https://trks.c1exchange.com/trk/c?pid=123&et=i&profileid=123&siteid=12345&adslot=AUM&adsize=300x250&imprtype=IMAGE&cpm=0.0&dspcid=834&rndid=368997882&adomain=[c1exchange.com]&urid=8787893965303118897&uimprid=2063341746607836879&urespid=0"]
}
},
"adomain": ["c1exchange.com"],
"cid": "834"
}]
}],
"cur": "USD"
}{
"id": "7979d0c78074638bbdf739ffdf285c7e1c74a691",
"seatbid": [{
"bid": [{
"id": "C1X1486125445685",
"impid": "12345",
"price": 0,
"adm": {
"native": {
"link": {
"url": "http: //i.am.a/URL"
},
"assets": [{
"id": "001",
"required": 1,
"title": {
"text": "Learn about this awesome thing"
}
}],
"imptrackers": ["https://trks.c1exchange.com/trk/c?pid=123&et=i&profileid=123&siteid=12345&adslot=AUM&adsize=300x250&imprtype=IMAGE&cpm=0.0&dspcid=834&rndid=368997882&adomain=[c1exchange.com]&urid=8787893965303118897&uimprid=2063341746607836879&urespid=0"]
}
},
"adomain": ["c1exchange.com"],
"cid": "834"
}]
}],
"cur": "USD"
}
the problem is i want to use it in my component without having a data model for the same
Presently in my component
ngOnInit() {
this.weatherService.getPocData().subscribe( res => {
this.openRtbResponse = res.openRtbResponse;
});
}
and in my template
{{openRtbResponse | json}}
I am able to access the same .
But now when i want to access the nested value like this it gives undefined like
this.openRtbResponse.seatbid[0].bid[0].adm.native.assets[0].id
its throws errors.
Without data model can't i use the json value