I wonder is it possible to check if observable received any value. And I want this without subscribing to it, because I am too lazy to overwrite my current code. Problem is that I create observable in parent component and then passing it to child components. And I need only one tiny thing from it, so subscribing just for that, seems unnecessary...
parent-component:
adverts$: Observable<advert[]>;
ngOnInit() {
this.adverts$ = this.advertService.advertsPerUser();
service:
advertsPerUser() {
return this.advertsKeysPerUser()
.map(adKeys => adKeys.map(adKey => this.afDb.object('adverts/' + adKey.$key )))
.flatMap(val => Observable.combineLatest(val) );
}
So my goal is in parent-component.html do something like:
<div *ngIf="adverts$">