Carlos Cifuentes
AngularJS library migration · REST client

Migrating ngResource ($resource) to modern Angular

$resource created objects with query, get, save and delete methods from a URL template.

What replaces it

OptionWhen to choose it
HttpClient with typed servicesExplicit get, create, update and delete methods per resource.
Generated client (OpenAPI)When the API has a spec and many endpoints.

How to migrate it

  1. Replace each $resource definition with a small typed service.
  2. Remove the pattern of empty objects that fill in later: return observables or signals instead.
  3. 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