0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/examples/angular/simple
History 2026-11-13 10:57:29 +09:00
..
.devcontainer chore(angular-query): update example dev containers to node 22 (#8370) 2024-11-28 17:24:46 +01:00
public docs(examples): use the TanStack Query emblem as the favicon in every example (#12578) 2026-11-12 13:33:29 +09:00
src docs(examples): unify page titles to 'TanStack <Framework> Query <Name> Example' and remove scaffold leftovers (#12580) 2026-11-12 14:54:59 +09:00
.gitignore docs(examples): use each framework's template '.gitignore' in every example (#12592) 2026-11-13 10:57:29 +09:00
angular.json docs(examples): use the TanStack Query emblem as the favicon in every example (#12578) 2026-11-12 13:33:29 +09:00
eslint.config.js chore(examples/*/eslint.config): use 'flat/recommended-strict' from '@tanstack/eslint-plugin-query' (#12385) 2026-10-26 02:55:51 +09:00
package.json ci: Version Packages (#12543) 2026-11-07 00:00:45 +01:00
README.md docs(examples): rewrite the READMEs, add the framework or router to example titles, and rename examples to '<feature>-<framework>' (#12583) 2026-11-12 16:58:15 +09:00
tsconfig.app.json ci: rename integration projects for consistency (#7875) 2024-08-09 20:09:09 +10:00
tsconfig.json chore(examples/*/tsconfig): include '*.config.ts' and '*.config.js' like the packages (#12408) 2026-10-27 09:11:08 +09:00

TanStack Angular Query Simple Example

Fetches a single GitHub repository and shows its stats.

How it works

  • src/app/components/simple-example.component.ts calls injectQuery with queryKey: ['repoData'] and a queryFn that fetches the TanStack/query repository with HttpClient and converts it with lastValueFrom.
  • src/app/components/simple-example.component.html renders from the query's signals: isPending(), isError() with error(), and data() for the repository's name, description and counts.
  • src/app/app.config.ts registers a QueryClient with provideTanStackQuery and withDevtools(), and provides HttpClient with provideHttpClient(withFetch()).

To run this example:

  • npm install
  • npm start