EDIT 30-07-2018 01:57 CET: Still looking for a solution to the problem below:
I have the following code:
getBoolean(dataRef1, dataRef2) {
const myFirstObservable = this.af.object(dataRef1).valueChanges();
const mySecondObservable = this.af.object(dataRef2).valueChanges();
return combineLatest(myFirstObservable, mySecondObservable).pipe(map(([data1, data2]) => data1 && data2)))
}
Basically what the code does is: it combines the results of the two observables and then checks each whether it has returned any value. If both observables have a value, return true else return false.
So far so good, everything is working as expected. I then call the method from my View, provide dynamic node references for the observables, and use the boolean to add a conditional element:
<div *ngIf="getBoolean('dataN', 'dataK') | async"> My lovely div content goes here</div>
However, my div does not display on my view at all.
Can someone tell me where I am wrong and help me achieve my desired result?