I have the following, I receive data in JSON format from a base in firebase using the following code:
constructor(db: AngularFirestore, private modalService: BsModalService) {
db.collection('usuarios').valueChanges()
.subscribe( ( data: Taxista[] ) => {
this.taxistas = data;
console.log('data->' + JSON.stringify(data));
});
}
in the HTML I use * ngFor to traverse the json:
<div class="list-group">
<a href="#" *ngFor="let taxista of taxistas" class="list-group-item list-group-item-action">
<strong> {{ taxista.nombre }} </strong><br>
This is the JSON format I receive from firebase:
[
{
"1": {
"demandado": "JOSE CARLOS PIÑOL PLANA",
"direccion": "Barlovento 1, Real Solare.",
"fecha_asignada": "2018-05-01 00:00:00",
"id_expediente": "1",
"lat": 20.6075857,
"lng": -100.3773038,
"status": "Inicio",
"tipo_juicio": "1"
},
"2": {
"demandado": "JUAN MANUEL BELMONTE HERMIDA",
"direccion": "Barlovento 1, Real Solare",
"fecha_asignada": "2018-06-14 00:00:00",
"id_expediente": "2",
"lat": "",
"lng": "",
"status": "",
"tipo_juicio": "1"
},
"3": {
"demandado": "JORGE AVILA BERRIO",
"direccion": "Barlovento 1, Real Solare.",
"fecha_asignada": "2018-05-01 00:00:00",
"id_expediente": "3",
"lat": "",
"lng": "",
"status": "",
"tipo_juicio": "1"
}
}
]
First problem is the JSON Id (it's incremental), sometimes more data can be, how can I go through this in the HTML?, I imagine something like this {{taxi driver [id] .address}}