I'm used to use the async pipe with "as" in an Angular HTML template to avoid replicating observable subscriptions, like this:
<component *ngIf="(selected$ | async) as selected"></component>
So then I can use "selected" anywhere else in the template.
But then if I try to use it like this, in an input:
<component [param]="(selected$ | async) as selected"></component>
I get an error:
Unexpected token 'as' at column 21 in [categories$ | async as categories]
Any idea why? Thanks!