Angular Petstore Services

Injectable Angular services with httpResource, Signals, and dependency injection

httpResource Examples

These services demonstrate Angular 19.2+ httpResource API with Signal-based reactive patterns. Each service method returns an HttpResourceRef with automatic request management.

pet.service.ts

Pet management service with CRUD operations

8 methodshttpResource

store.service.ts

Store order management service

3 methodshttpResource

user.service.ts

User authentication and management service

7 methodshttpResource

base-api.service.ts

Base class for all API services with shared functionality

What is httpResource?

httpResource is Angular's new Signal-based HTTP API introduced in version 19.2. It provides:

  • Automatic request management - No need to manually subscribe/unsubscribe
  • Signal integration - Reactive data with Angular Signals
  • Better performance - Optimized change detection
  • Type safety - Full TypeScript support with generics