DEV Community

Discussion on: Building Reactive Angular Templates with NgRx Component

Collapse
 
benlune profile image
Benoît Plâtre

Hi Marko,
Thanks a lot for this article and your work!
I'm used to work with ngrx since long time, and I would to go fully zoneless. I started a project to test it with ComponentStore, ngrxLet or ngrxPush but it doesn't work, nothing is displayed. I can trace the loaded data (from Drupal) in the console thanks to tap operator, but nothing reacts in the template.
Could you please tell me if there is something special to do ? Or do you have an example of zoneLess small app with ngrx?

Collapse
 
benlune profile image
Benoît Plâtre

Hi Marko,
I found a solution, inspired by the angular-movies zoneless project created by rx-angular team (thanks a lot to them!).
github.com/tastejs/angular-movies

My project needs routing, and I had to listen to NavigationEnd event and then trigger an applicationRef.tick() in order to render my data zoneless, like this :
github.com/tastejs/angular-movies/...

Collapse
 
markostanimirovic profile image
Marko Stanimirović

Great! Here is another example: ngrx.io/api/component/RenderSchedu...

You can use 'RenderScheduler' to schedule a new change detection cycle on route changes. 'RenderScheduler' is also used by 'LetDirective' and 'PushPipe' to trigger CD.

Collapse
 
markostanimirovic profile image
Marko Stanimirović

Thanks Benoit! :)

I'll be glad to help you. Can you create a reproduction via StackBlitz or GitHub repo? Also, feel free to open an issue with provided reproduction here: github.com/ngrx/platform

Collapse
 
markostanimirovic profile image
Marko Stanimirović

@benlune

Here is the example of small zone-less app with @ngrx/component v14.1.0: stackblitz.com/edit/angular-zy74xp...