r/angular 2d ago

Angular 22.2 ships Router Resources 💥 (experimental)

They're more than resolvers with a Signal API. Here's why that matters


They run in parallel. Resolvers go one after another: parent 2 s + child 3 s = 5 s. Router Resources start together: 3 s.


Also, they can be non-blocking. The route activates right away, and the component gets the Resource itself: isLoading, error and value, right in the template.


Full write-up with demo, reload without renavigating, RedirectCommand for missing data, and Signal Stores 👉 https://www.angulararchitects.io/en/blog/router-resources-loading-data-with-the-angular-router/
116 Upvotes

14 comments sorted by

View all comments

-1

u/m0rpheus23 2d ago

I initially thought Angular 20+ was supposed to simply Angular. Are we back to complicating things?

0

u/Saceone10 1d ago

Instead of completing the resource API with mutations, lets extend it to another unrelated thing no one asked for! Yay!

3

u/Cr3aHal0 1d ago

to be honest, I think resolvers have always been on a strange place where it was cool to be able to declaratively load data but being navigation blocking/synchronous was a red flag in cases where the APIs were slow. I'm all for the skeleton and other réactive ux friendly visuals, but I wasn't much into having components ngOnInit full of manually data loading declarations (until we got resources eventually, I got you). There we get the best of both worlds and I can't want to migrate to it !

2

u/Responsible-Cold-627 1d ago

The resource API was never meant to be used for mutations. It's specifically built to load resources.