mirror of
https://github.com/TanStack/query.git
synced 2026-11-16 22:50:20 +00:00
|
History
|
||
|---|---|---|
| .. | ||
| .devcontainer | ||
| public | ||
| src | ||
| .gitignore | ||
| angular.json | ||
| eslint.config.js | ||
| package.json | ||
| README.md | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
TanStack Angular Query Simple Example
Fetches a single GitHub repository and shows its stats.
How it works
src/app/components/simple-example.component.tscallsinjectQuerywithqueryKey: ['repoData']and aqueryFnthat fetches theTanStack/queryrepository withHttpClientand converts it withlastValueFrom.src/app/components/simple-example.component.htmlrenders from the query's signals:isPending(),isError()witherror(), anddata()for the repository's name, description and counts.src/app/app.config.tsregisters aQueryClientwithprovideTanStackQueryandwithDevtools(), and providesHttpClientwithprovideHttpClient(withFetch()).
To run this example:
npm installnpm start