DEV Community

Discussion on: Use "async as" to cleanup Angular templates

constjs profile image
Piotr Lewandowski • Edited on

I'd like to see directive for this in Angular core ;)

*ngIf has drawback to check falseness of value.
For example when observed values are numbers, when value comes by and is 0, it will never be shown.

<span *ngIf="counter$ | async as counter">
    Hello {{ counter }}

This is something to know to avoid surprises. ;)