Open History to see the last commit
1---
2id: provideAngularQuery
3title: provideAngularQuery
4---
5β
6# Function: provideAngularQuery()
7β
8```ts
9function provideAngularQuery(queryClient): EnvironmentProviders
10```
11β
12Sets up providers necessary to enable TanStack Query functionality for Angular applications.
13β
14Allows to configure a `QueryClient`.
15β
16**Example - standalone**
17β
18```ts
19import {
20 provideAngularQuery,
21 QueryClient,
22} from '@tanstack/angular-query-experimental'
23β
24bootstrapApplication(AppComponent, {
25 providers: [provideAngularQuery(new QueryClient())],
26})
27```
28β
29**Example - NgModule-based**
30β
31```ts
32import {
33 provideAngularQuery,
34 QueryClient,
35} from '@tanstack/angular-query-experimental'
36β
37@NgModule({
38 declarations: [AppComponent],
39 imports: [BrowserModule],
40 providers: [provideAngularQuery(new QueryClient())],
41 bootstrap: [AppComponent],
42})
43export class AppModule {}
44```
45β
46## Parameters
47β
48β’ **queryClient**: `QueryClient`
49β
50A `QueryClient` instance.
51β
52## Returns
53β
54`EnvironmentProviders`
55β
56A set of providers to set up TanStack Query.
57β
58## See
59β
60https://tanstack.com/query/v5/docs/framework/angular/quick-start
61β
62## Defined in
63β
64[providers.ts:50](https://github.com/TanStack/query/blob/27861961bbb36e9bc25fcd45cff21b5645f02f9b/packages/angular-query-experimental/src/providers.ts#L50)