examples/angular/simple
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
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