DEV Community


Discussion on: Initial Null Problem of AsyncPipe and async data-binding

lacolaco profile image
Suguru Inatomi Author

Thank you Lars! Yes, I'd love to!

As you says, *rxSubscrive and *ngFor or other structural directives cannot be at the same place. I recommend adding <ng-container *rxSubscribe> at the root for subscribing to a stream.

<ng-container *rxSubscribe="state$; let state">
   ...sync-full template...
layzee profile image
Lars Gyrup Brink Nielsen • Edited

Come to our Slack workspace, and Max will set you up on the new site 🙌

I think it would be useful to show an example with a for loop such as:

<ng-container *rxSubscribe="order$; let order">
  <div *ngFor="let item of order">
    {{ item }}

Did you consider supporting microsyntax? Something like

<ng-container *rxSubscribe="state$ next state">
   ...sync-full template...

Maybe even

<ng-container *rxSubscribe="state$ next state; error as err; complete: onComplete">
   ...sync-full template...
Forem Open with the Forem app