I have an Subject
which provides me with number
. In my template, I would like to render this number in braces, if it is higher than 0.
Theoretically something like this (this does not work though):
{{ ($number | async) > 0 ? '('+ ($number| async) +')' : '' }}
How would I render an subject, based on a condition of its own value?
use ngIf
conditions and assign the observable result to variable
<div *ngIf="$number | async as num">
<div *ngIf="num> 0"> '(' {{num}} ')' </div>
</div>