Hi, I’m trying to get data from a reference node in firebase. I’m able to get the first list of data (needed to query the second node) but I’m unable to get the final data since the function that needs to be called to get that data is never called by the first one when finished.
This is the firebase node:
I can get the ‘jugadores’ UID and using this I want to get all the data related to that node
And the code:
this.dbFirebase.getListJugadores(this.equipo.id).subscribe(res=>{
this.jugadores = res; this.jugadorList = this.jugadores.map(function (key){ this.dbFirebase.getJugadorObject(key); }); });
firebase-db.ts:
this is working fine, I can get the list of objects inside this node.
getListJugadores(equipoUID){
return this.afDB.list(‘equipos/’ + equipoUID + ‘/jugadores/’).valueChanges();
}
But this function is never called (the log is never printed in the console)
getJugadorObject(key){
console.log(“[getJugadorObject] Buscando en la lista de jugadores…”);
return this.afDB.object(‘jugadores/’ +${key.$key}
);
}
Thanks