Modern Data Fetching Techniques in Angular
summary
Angular offers two signal-based fetch APIs: resource uses fetch and httpResource uses HttpClient. Each resource is created with three inputs — params, default value, loader — and exposes signals for value, status, loading, snapshot, and error; params are tracked but loaders are not, so put signals into params to trigger reloads. Abort via AbortSignal cancels in-flight requests. resource can use fetch or websockets (no interceptors); httpResource integrates with interceptors and DI. Use both for reads only, not mutations.
AI-written summary · about
