Angular http client

From HoangNguyen0403/agent-skills-standard · View interactive version

Angular http client is an AI agent skill from the GitHub repository HoangNguyen0403/agent-skills-standard. Integrate HttpClient, Interceptors, and API interactions in Angular. Use when integrating HttpClient, writing interceptors, or handling API calls in Angular.

How to use this skill

Skill file

HTTP Client

**Priority: P1 (HIGH)**

Principles

Signal-Based HTTP (Angular 17+)

Prefer httpResource<T>() over manual subscribe for reactive data loading — it auto-refetches when its signal inputs change:

// Reactive: refetches automatically when userId() changes
userResource = httpResource<User>(() => `/api/users/${this.userId()}`);
// States: .isLoading() | .hasValue() | .error() | .value() | .reload()

Use resource<T, P>({ request: () => params(), loader: ... }) for non-HTTP async operations with full .isLoading() lifecycle control.

Guidelines

Anti-Patterns

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.