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 | user1@example.com | Admin |
| 2 | User 2 | user2@example.com | Editor |
| 3 | User 3 | user3@example.com | Viewer |
| 4 | User 4 | user4@example.com | Admin |
| 5 | User 5 | user5@example.com | Editor |
| 6 | User 6 | user6@example.com | Viewer |
| 7 | User 7 | user7@example.com | Admin |
| 8 | User 8 | user8@example.com | Editor |
filterMode="none" plus queryChange — options come from the resource.
Bind [items] to list.value(). Only visible rows stay in the DOM.