I have an observable that I would like to create a variable with in the ngIf as well as only return false if the value is null (the observable returns a number)
I need to explicitly check for null as my observable can return 0 as a value which triggers the else block.
I have tried the following
*ngIf="(observable$ | async) as obs; obs !== null; esle #elseTemplate"
*ngIf="((observable$ | async) as obs) !== null; esle #elseTemplate"
*ngIf="(observable$ | async) !== null; $implicit = obs; else #elseTemplate"
// this returns the boolean
My current solution which doesn't seem very elegant is
*ngIf="(observable$ | async) !== null; esle #elseTemplate"
{{ observable$ | async }}
I am using Angular 10.