function provideAngularQuery(queryClient): EnvironmentProviders
function provideAngularQuery(queryClient): EnvironmentProviders
Sets up providers necessary to enable TanStack Query functionality for Angular applications.
Allows to configure a QueryClient.
Example - standalone
import {
provideAngularQuery,
QueryClient,
} from '@tanstack/angular-query-experimental'
bootstrapApplication(AppComponent, {
providers: [provideAngularQuery(new QueryClient())],
})
import {
provideAngularQuery,
QueryClient,
} from '@tanstack/angular-query-experimental'
bootstrapApplication(AppComponent, {
providers: [provideAngularQuery(new QueryClient())],
})
Example - NgModule-based
import {
provideAngularQuery,
QueryClient,
} from '@tanstack/angular-query-experimental'
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
providers: [provideAngularQuery(new QueryClient())],
bootstrap: [AppComponent],
})
export class AppModule {}
import {
provideAngularQuery,
QueryClient,
} from '@tanstack/angular-query-experimental'
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
providers: [provideAngularQuery(new QueryClient())],
bootstrap: [AppComponent],
})
export class AppModule {}
• queryClient: QueryClient
A QueryClient instance.
EnvironmentProviders
A set of providers to set up TanStack Query.
https://tanstack.com/query/v5/docs/framework/angular/quick-start