I created a new angular6 project with angularfire2 and rxjs 6. I am debugging the loading bar to be shown while loading observables.
my ts code:
import { combineLatest, Observable } from 'rxjs';
groups: Observable<Array<any>>;
singles: Observable<Array<any>>;
combined: Observable<Object>;
public loadall()
{
this.groups= this.db.collection('groups').valueChanges();
this.singles= this.db.collection('singles').valueChanges();
this.combined = combineLatest(this.groups, this.singles);
//took this from https://auth0.com/blog/whats-new-in-rxjs-6/
}
my html template:
<ng-template #loading>
<div class="loader"></div>
</ng-template>
<div *ngIf="combined | async; else loading"> //this div
<div *ngFor="let group of groups | async">
{{ group.name }}
<div *ngFor="let single of singles | async">
{{ single.name }}
</div>
</div>
</div>
Currently without the //this div bracket, the output will be displayed. However, with the //this div bracket, output does not get displayed.
With the previous version of rxjs, I used:
this.combined = Observable.combineLatest(query$);
And this works. So I figure my implementation of the combineLatest operator is wrong. Appreciate help to further debug this.