angular - Angular4 ngIf local variable assignment and comparison at the same time? -
i'm using new angular local variable assignment feature reference result of async pipe in child elements under ngif:
<nav *ngif="dataservice.count$ | async count"> <div *ngif="count > 1"> there's more one! it's {{count}}. </div> </nav> as can see, have div in hierarchy grab result of async pipe , comparison against it. feel should able in single expression can't find enough documentation new feature. i've tried variety of approaches parens, using | async; let count instead, etc, can't figure out how both things in 1 line.
(a pointer documentation on local variable declaration syntax in ngif appreciated -- had never heard of foo$ | async foo until saw here on so.)
Comments
Post a Comment