I'm trying to flatten a nested Observable, but I'm not getting it to work:
this.af.object('test/father')
.map(res => {
res.namedKeys = [];
for (let el in res.keys) {
res.namedKeys.push(this.af.object(`test/keys/${el}`))
}
return res
})
.flatMap(res => Observable.combineLatest(res))
.subscribe(res => {
console.log('The final response:', res);
});
I want to get the actual data of the Observables in my Array. I've tried a lot of different things the last 2 days, but in the end, I receive either nothing or still the Array with Observables in it. The code above is returning nothing.