devtools/docs/framework/angular/basic-setup.md
Riccardo Perra ad26f6182f
feat(angular): angular adapter and utils (#368)
* feat(angular-devtools): create angular adapter package

Add the @tanstack/angular-devtools package with:
- TanStackDevtoolsComponent: standalone Angular component that wraps TanStackDevtoolsCore
- Plugin system supporting Angular components rendered into devtools containers
- Type definitions for Angular-specific plugin and init configuration
- Build config using @analogjs/vite-plugin-angular for AOT compilation

* fix(angular-devtools): add reactivity for input changes, remove unused RenderArray

* feat(devtools-utils): add angular support

* fix: resolve angular build issues

- Remove @analogjs/vite-plugin-angular from build (produces empty chunks
  for library builds). Use plain esbuild via Vite instead - Angular AOT
  compilation happens at consumer's build time.
- Upgrade Angular dev deps from ^19 to ^20 for TypeScript 5.9 compat.
- Remove @angular/build dep (only needed by analogjs plugin).
- Add @tanstack/angular-devtools workspace override to root.

* ci: apply automated fixes

* fix: resolve lint, knip, and sherif issues

- Fix array-type ESLint rule in angular-devtools
- Fix import/consistent-type-specifier-style in devtools-utils angular
- Sort peerDependencies alphabetically (sherif)
- Remove unused devDependencies flagged by knip
- Remove angularCompilerOptions from tsconfig (not using ngc)

* feat: add Angular support with setup, adapter, and custom plugin documentation

* feat(angular): angular adapter add utils and some examples, fix build

* ci: apply automated fixes

* feat: Add angular adapter and devtools-utils/angular

* remove afterNextRender in devtools-utils

Since angular-devtools already run the code within afterNextRender in browser env, we don't like to wrap the panel returned from utils

* fix examples

* fix angular devtools wrong pnpm link

* feat(angular-devtools): add with-devtools provider

* docs(angular-devtools): update docs

* ci: apply automated fixes

* chore(angular-devtools): fix examples dependencies and knip issues

* feat(angular-devtools): rename withDevtools to provideTanStackDevtools

* Add a11y plugin for angular

* chore(deps): update @tanstack/devtools and related packages

* ci: apply automated fixes

---------

Co-authored-by: Alem Tuzlak <t.zlak@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-04-28 20:17:46 +02:00

1.8 KiB

title id
Basic setup basic-setup

TanStack Devtools provides you with an easy-to-use and modular client that allows you to compose multiple devtools into one easy-to-use panel.

Setup

Install the TanStack Devtools library. This will install the devtools core as well as provide you with the Angular-specific adapter.

npm i @tanstack/angular-devtools

Next, in the root of your application, import the TanStackDevtoolsComponent from @tanstack/angular-devtools and add it to your template.

import { Component } from '@angular/core'
import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [TanStackDevtools],
  template: `
    <app-content />
    <tanstack-devtools />
  `,
})
export class App {}

Import the desired devtools and provide them to the TanStackDevtools via the [plugins] input along with a label for the menu.

import { Component } from '@angular/core'
import { TanStackDevtools } from '@tanstack/angular-devtools'
import type { TanStackDevtoolsAngularPlugin } from '@tanstack/angular-devtools'
import { AngularQueryDevtoolsPanel } from '@tanstack/angular-query-devtools'

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [TanStackDevtools],
  template: `
    <app-content />
    <tanstack-devtools [plugins]="plugins" />
  `,
})
export class AppComponent {
  plugins: Array<TanStackDevtoolsAngularPlugin> = [
    {
      name: 'Angular Query',
      render: AngularQueryDevtoolsPanel,
    },
  ]
}

Finally, add any additional configuration you desire to the TanStackDevtools. More information can be found under the TanStack Devtools Configuration section.