examples/angular/devtools-panel-angular-router
| Name | Last commit message | Last commit date |
|---|---|---|
| .. | ||
README.md
TanStack Angular Query Devtools Panel Example (Angular Router)#
Embeds the devtools as a panel inside the page instead of the floating toggle.
Built with Angular Router.
How it works#
src/app/services/repos/queries.tsis an@InjectableReposQuerieswhosedetail()returnsqueryOptionsthat fetch theTanStack/queryrepository withHttpClientandlastValueFrom.src/app/components/example-query.component.tsreads it withinjectQuery(() => this.#reposQueries.detail())and is rendered on both routes.src/app/components/basic-devtools-panel-example.component.tscallsinjectDevtoolsPanelwith the<div>fromviewChildashostElement, so the panel mounts in that<div>while it is open.src/app/components/lazy-load-devtools-panel-example.component.tsimports@tanstack/angular-query-devtools/devtools-panelin aneffectonly the first time the panel is opened, then callsinjectDevtoolsPanelwith the component'sInjector.src/app/app.routes.tslazy loads the two examples atbasicandlazywithloadComponent, andsrc/app/app.config.tsregistersprovideTanStackQuerywithoutwithDevtools().
To run this example:
npm installnpm start