I need to access the firstBill
value in this json:
[{
"companyName": "Madrid",
"producCompanyId": 4,
"productCompanyName": "Empresa1",
"state": {
"id": 5,
"description": "Completada sin precios"
},
"message": "\nHay otra empresa igual en ACTIVO "
}, {
"companyName": "Barcelona",
"producCompanyId": 10,
"productCompanyName": "Empresa2",
"companyResultId": "889",
"state": {
"id": 4,
"description": "Completada con precios"
},
"prices": {
"priceList": [{
"priceId": 699614,
"companyPriceId": "1091931204",
"firstBill": 281.96,
"issuable": true
}, {
"priceId": 699609,
"companyPriceId": "1091931204",
"firstBill": 251.64,
"issuable": true
}, {
"priceId": 699611,
"companyPriceId": "1091931204",
"firstBill": 302.6,
"issuable": true
}]
},
"message": ""
}]
Now I have this code but with errors because of undefined prices
jsonarray in other (the first one of the previous json) objects:
<ion-content class="home">
<ion-list>
<ion-item *ngFor="let oferta of ofertas">
<h2>{{oferta.companyName}}</h2>
<pre>{{ oferta.prices.priceList[0] ? oferta.prices.priceList[0] | json }}</pre>
</ion-item>
</ion-list>
</ion-content>