File size: 1,432 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
id: withDevtools
title: withDevtools
---

# Function: withDevtools()

```ts
function withDevtools(withDevtoolsFn?): DeveloperToolsFeature
```

Enables developer tools.

**Example**

```ts
export const appConfig: ApplicationConfig = {
  providers: [provideTanStackQuery(new QueryClient(), withDevtools())],
}
```

By default the devtools will be loaded when Angular runs in development mode and rendered in `<body>`.

If you need more control over when devtools are loaded, you can use the `loadDevtools` option. This is particularly useful if you want to load devtools based on environment configurations. For instance, you might have a test environment running in production mode but still require devtools to be available.

If you need more control over where devtools are rendered, consider `injectDevtoolsPanel`. This allows rendering devtools inside your own devtools for example.

## Parameters

### withDevtoolsFn?

() => [`DevtoolsOptions`](../../interfaces/devtoolsoptions.md)

A function that returns `DevtoolsOptions`.

## Returns

[`DeveloperToolsFeature`](../../type-aliases/developertoolsfeature.md)

A set of providers for use with `provideTanStackQuery`.

## See

- [provideTanStackQuery](../providetanstackquery.md)
- [DevtoolsOptions](../../interfaces/devtoolsoptions.md)

## Defined in

[providers.ts:262](https://github.com/TanStack/query/blob/main/packages/angular-query-experimental/src/providers.ts#L262)