The following structural directive will subscribe to the named observable and assign the locally scoped variable srl to the value. The content only gets rendered when the result is truthy.
<ng-container *ngIf="searchResultLength$ | async as srl">
(search results goes here)
</ng-container>
But what is the syntax if I want to have some other type of logical operator? What I want to do is:
<ng-container *ngIf="(searchResultLength$ | async as srl) > 2">
(search results IF there are more than 2 goes here)
</ng-container>
Which looks to me like it should the correct syntax but is rejected by the compiler. I can't find the document for how the as keyword is parsed. Can someone clue me in what the correct syntax should be?
Also, a link to the relevant documentation would help. Doing searches for the as keyword is as futile as it gets.
(searchResultLength$ | async as srl).length > 2