Migrating ngResource ($resource) to modern Angular
$resource created objects with query, get, save and delete methods from a URL template.
What replaces it
| Option | When to choose it |
|---|---|
| HttpClient with typed services | Explicit get, create, update and delete methods per resource. |
| Generated client (OpenAPI) | When the API has a spec and many endpoints. |
How to migrate it
- Replace each $resource definition with a small typed service.
- Remove the pattern of empty objects that fill in later: return observables or signals instead.
- Move instance methods ($save, $delete) to service methods that receive the entity.
Watch out. $resource returns an empty array or object immediately and fills it when the response arrives. Templates that relied on that need an explicit loading state.
Other libraries
Planning a migration or a micro-frontend platform?
In a 20-minute call you describe your situation and I tell you how I'd approach it. If it isn't worth doing yet, I'll say so.
Message me on LinkedIn