What kind of friends, I have this following problem, it happens that I have 2 tables in firebase which I would like you to share data, this is matrices of the db:
clientes: {
1: {
nombre: "Juan";
empresas: {
emp1: true;
emp2: true;
}
}
2: {
nombre: "Carlos";
id_empresa: "emp2";
empresas: {
emp2: true;
}
}
}
empresas: {
emp1: {
nombre_empresa: "Empresa 1";
}
emp2: {
nombre_empresa: "Empresa 2";
}
}
I would like to know how to make a union of these tables: This is the code but it still does not work, am I on track ?:
getClientes () {
return this.afoDatabase.list('/clientes')
.map ( items => {
return items.map ( item => {
item.nombreEmpresa = this.afoDatabase.object('empresas' + item.$key + '/nombre')
.subscribe( data => {
return data;
});
});
});
}