Cookbooks / httpResource
This page uses Angular httpResource() keyed off query, page, and sort signals. The docs site answers those requests with a fixture interceptor so prerender has no backend. Point the same URL factory at your API. The same signals drive data-table, combobox, and virtual-scroll.
The demos below already call httpResource. In your app, change the URL (JSON) or switch to rxResource if the source is already an Observable.
readonly query = signal('');
readonly users = httpResource(() => ({
url: '/api/users',
params: { q: this.query() },
}));readonly users = rxResource({
params: () => this.query(),
stream: ({ params }) => this.http.get<User[]>('/api/users', { params: { q: params } }),
}); Type to debounce the query, then page and sort. serverSide keeps slicing in httpResource, not in the table.
ID | Name | Email | Role |
|---|---|---|---|
| 1 | User 1 | [email protected] | Admin |
| 2 | User 2 | [email protected] | Editor |
| 3 | User 3 | [email protected] | Viewer |
| 4 | User 4 | [email protected] | Admin |
| 5 | User 5 | [email protected] | Editor |
| 6 | User 6 | [email protected] | Viewer |
| 7 | User 7 | [email protected] | Admin |
| 8 | User 8 | [email protected] | Editor |
filterMode="none" plus queryChange — options come from the resource.
Bind [items] to list.value(). Only visible rows stay in the DOM.