When using an *ngIf
, you can do something like *ngIf = (value$ | async).property as prop
and then use prop
throughout your code without needing to repeat the long (value$ | async).property
each time. However, this only works if (value$ | async).property
is a truthy value - and not if it is zero for instance.
My question is - how can I still reap the benefits of as
but still have the element show if the value is falsy? Or better yet, is there a way to use as
outside of an *ngIf
or the like?