I am working with Angular 8 and implementing the following code:
<ng-container *ngIf="(count$ | async) as count; else loader">{{count}}</ng-container>
<ng-template #loader>
loading
</ng-template>
The variable count$
is of type Observable<number>
...
When the value of count$
is 1
, 2
, etc it displays correctly.
However, when the value of count$
is 0
, it only shows loading
.
Any thoughts on why this may be happening?