Angular 22 released a stable version of the Resource API, providing a complete API to query an API, now including loading/errors states builtin and some other features to improve our dev experience.

One place in Angular apps where we need to make API calls are Guards... and Resolvers.

They both block a current navigation to resolve their internal logic:

For Guards, the point is to prevent accessing the target route if falsy, used to prevent a user from accessing some route requiring to display data they are not allowed to (preventing UI errors as API calls will be rejected).

For Resolvers, the idea is to retrieve some data before hitting the target route, to pass it to the router and get it ready as soon as the component is rendered.