Angular Type 'boolean | null' is not assignable to type 'boolean'.

7/27/2021 Angular

the async pipes return signature is something like <T>(input$: Observable<T>: T | null always, because it returns null to the template while it's awaiting a response from an asynchronous call.

# you can do what you've done and allow null, or if you know it will never be null, use a non null assertion operator:

[loaded]="(loaded$ | async)!"
1

# or disable type checking here:

[loaded]="$any(loaded$ | async)"
1

# or for this particular case you could probably do something like this:

[loaded]="(loaded$ | async) || false"
1
Last Updated: 12/26/2022, 11:54:10 AM