Skip to content

Latest commit

 

History

History
58 lines (38 loc) · 1.19 KB

provideangularquery.md

File metadata and controls

58 lines (38 loc) · 1.19 KB
id title
provideAngularQuery
provideAngularQuery

Function: provideAngularQuery()

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'

bootstrapApplication(AppComponent, {
  providers: [provideAngularQuery(new QueryClient())],
})

Example - NgModule-based

import { provideAngularQuery, QueryClient } from '@tanstack/angular-query'

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule],
  providers: [provideAngularQuery(new QueryClient())],
  bootstrap: [AppComponent],
})
export class AppModule {}

Parameters

queryClient: QueryClient

A QueryClient instance.

Returns

EnvironmentProviders

A set of providers to set up TanStack Query.

See

https://tanstack.com/query/v5/docs/framework/angular/quick-start

Defined in

providers.ts:50