Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsAngular’s resource APIs bring asynchronous reads into signal-based code. You describe what the read depends on, supply a loader, and read the result as signals for value, status, and errors. Use resource() for a custom asynchronous loader, httpResource() when the read goes through Angular’s HttpClient stack, rxResource() when your source is already an RxJS Observable, and Router resources when the data belongs to a matched route. Mutations such as POST or PUT stay on direct HttpClient calls. Resources manage reads and request state; they do not replace writes.
Choosing the right API
The four APIs differ mainly in where the data comes from and where the loading state is surfaced. The table below lists the practical differences documented by Angular.
As an Amazon Associate I earn from qualifying purchases.
| Need | API | What it gives you |
|---|---|---|
| General asynchronous read or custom loader | resource() |
A loader that receives params, the previous status, and an AbortSignal. It can resolve once per request or emit repeatedly through stream. (Angular: Async reactivity with resources) |
| HTTP read through Angular’s configured HTTP stack | httpResource() |
Requests go through HttpClient, so interceptors and HTTP testing apply. JSON is parsed by default, with text, Blob, and ArrayBuffer variants. (Angular: Reactive data fetching with httpResource) |
| Existing Observable-based source | rxResource() |
Behaves like resource(), but the loader maps the request to an RxJS Observable. (Angular API: rxResource) |
| Data attached to matched routes | Router resources configuration |
Routes load concurrently. Blocking is the default; nonBlocking() lets the component render its own loading and error states. (Angular: Data fetching with resources) |
| Create, update, or delete request | Direct HttpClient calls |
Angular advises against httpResource() for mutations such as POST and PUT. |
When you compare options for a specific screen, check four things: how the data source is represented (a Promise-returning loader, an Observable, an HTTP request, or route data); whether the operation is a read or a write; whether navigation should wait for the data or the component should render a loading state; and whether you need HttpClient interceptors or its testing utilities.
Fetching data with resource()
A resource takes a reactive params function and a loader. Angular re-runs the loader when any signal read inside params changes. If a load is still in progress, it is aborted first. Pass the abortSignal to fetch or another cancellation-aware call so obsolete work actually stops.
#1 Best Overall
import { resource, signal } from '@angular/core';
const userId = signal<number | undefined>(1);
const user = resource({
params: () => (userId() === undefined ? undefined : { id: userId() }),
loader: async ({ params, abortSignal }) => {
const response = await fetch(`/api/users/${params.id}`, { signal: abortSignal });
return response.json();
},
});
In this sketch, setting userId to undefined makes params return undefined. Angular then skips the loader and the status becomes idle. This is the usual way to express “nothing to load yet” without a separate flag.
One result or a continuous stream
Use loader when each request produces one result. Use stream for sources that keep producing values, such as WebSockets, Server-Sent Events, or Firestore onSnapshot listeners. In that case the resource’s value can update more than once for the same set of params.
Reading state safely
A resource exposes status, value, error, isLoading, snapshot, and hasValue. Reading value while the resource is in an error state throws. Guard the read with hasValue() in templates and logic, and drive loading and error UI from the state signals. Skipping this check is the most common way a resource-based component breaks in production.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
Using httpResource() instead of HttpClient
httpResource() is a reactive wrapper over Angular’s HttpClient. Interceptors, XSRF configuration, and HTTP testing all apply. Configure them with provideHttpClient(...) in the usual way. The main behavioral difference is timing: a resource starts eagerly as its request signals resolve, while a plain HttpClient Observable does nothing until something subscribes. When a reactive request value changes, the resource issues a new request and cancels the pending one.
Choose httpResource() over a bare HttpClient call when a template or signal-based computation needs the response as a reactive value and you want the loading and error state tracked for you. Keep a direct HttpClient call when you need explicit subscription control, when you are performing a write, or when the response is consumed in an imperative workflow rather than rendered.
Response types and parsing
JSON is the default response format. For other body types, use httpResource.text(), httpResource.blob(), or httpResource.arrayBuffer(). A parse option can validate or transform the response, and the return type of that function becomes the resource’s value type. Angular’s guide shows schema validation as an example, but it does not require any particular validation library.
Rank #3
Download progress
Set reportProgress: true to receive download progress; the latest figure is exposed through the resource’s progress signal. The Angular guide points out that this option covers downloads only. HttpClient’s newer options, which separate upload and download progress, are a different mechanism.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Observable sources with rxResource()
If your data layer already returns Observables, rxResource() keeps that code intact. Its loader maps the request to an RxJS Observable, and it otherwise behaves like resource(), with the same signal-based state. It is the natural choice when a service exposes streams and you want the result as a signal without converting every call to a Promise.
Router resources
Route resources bring data loading into the Router’s navigation cycle. Resources declared on matched routes load concurrently. By default they are blocking: the Router waits for them to complete, binds the resolved value to the component input, and cancels navigation if a load fails.
Rank #4
- Blocking (default): the component activates only after the data arrives, so it never renders a loading state of its own.
- Non-blocking: wrapping the resource with
nonBlocking()activates the component immediately and exposes the full resource state, so the component can render loading and error UI. - Refreshing: calling
reload(), or changing a tracked route parameter, refreshes the data without navigating again.
Track only the route fields the resource actually uses. If a resource reads the entire params object, it can refetch when an unrelated parameter changes, because the Router builds a new object on every navigation. Reading the specific key avoids that extra work. The Router guide’s timing comparison between sequential and parallel loading is a hypothetical illustration, not a measured benchmark.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Server rendering and hydration
During server-side rendering, a resource loader runs to produce the initial HTML. Unless its result is transferred, the browser runs the loader again during hydration. Giving the resource a unique id lets Angular place the resolved value in TransferState, so the client starts from the server’s result. The id must be unique within the application and identical on server and client.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Do not use this for user-specific data when the rendered HTML could be cached or shared. The cached value is serialized into the HTML, so anyone who receives that page can read it.
Keep mutations on HttpClient
Resources are designed for reads. Angular’s guidance is to use direct HttpClient APIs for mutations. The documentation also warns that cancelling a resource can prematurely abort a mutation, which is one more reason not to route writes through a reactive read. Angular’s exact guidance on httpResource reads: “Avoid using httpResource for mutations like POST or PUT.” (Angular, “Reactive data fetching with httpResource”)
A practical split looks like this: a resource loads the list or record a screen displays, and an event handler calls HttpClient to save a change. After a successful save, call reload() on the resource (or change the params signal) so the view reflects the new server state.
Version and availability
Angular’s API references list resource, httpResource, Resource, and rxResource as stable since Angular v22.0. Confirm the Angular version in your project (for example, with ng version) before adopting these APIs in an application on an earlier major version, and check the API reference for the version you run.
Angular’s signal documentation also states the underlying model: “A Resource gives you a way to incorporate async data into your application’s signal-based code and still allow you to access its data synchronously.” (Angular, “Async reactivity with resources”)
Common pitfalls
- Reading
valuein an error state throws; checkhasValue()or handleerror()first. - Returning a request from
paramsthat is always defined means the loader always runs; returnundefinedwhen there is nothing to fetch. - Ignoring
abortSignallets stale requests finish and write old values, so pass it to every cancellation-aware call. - Using
httpResource()for a POST or PUT moves a write into a read-oriented lifecycle. - Caching user-specific data through
TransferStateexposes it in server-rendered HTML.
For the full option list and current signatures, see the resource API reference, the httpResource API reference, the Resource type reference, and the rxResource API reference.
The Bottom Line
Use httpResource() when a signal-driven read goes through HttpClient and you want its loading and error state handled for you. Use resource() for custom asynchronous loaders, rxResource() for Observable sources, and Router resources for route-level data. Keep every create, update, and delete on direct HttpClient calls.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




