Skip to content

Commit a9b3eaf

Browse files
docs(angular-query): add pagination example (#8124)
* docs(angular-query): add pagination example * ci: apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 69476f0 commit a9b3eaf

30 files changed

+528
-41
lines changed

docs/config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,10 @@
10381038
"label": "Basic",
10391039
"to": "framework/angular/examples/basic"
10401040
},
1041+
{
1042+
"label": "Pagination",
1043+
"to": "framework/angular/examples/pagination"
1044+
},
10411045
{
10421046
"label": "Infinite query with Max pages",
10431047
"to": "framework/angular/examples/infinite-query-with-max-pages"

examples/angular/basic/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Angular Query basic example
1+
# TanStack Query Angular basic example
22

33
To run this example:
44

examples/angular/basic/src/app/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { ApplicationConfig } from '@angular/core'
77

88
export const appConfig: ApplicationConfig = {
99
providers: [
10-
provideHttpClient(withFetch()),
1110
provideAngularQuery(
1211
new QueryClient({
1312
defaultOptions: {
@@ -17,5 +16,6 @@ export const appConfig: ApplicationConfig = {
1716
},
1817
}),
1918
),
19+
provideHttpClient(withFetch()),
2020
],
2121
}

examples/angular/basic/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<link rel="icon" type="image/x-icon" href="favicon.ico" />
99
</head>
1010
<body>
11-
<basic-example />
11+
<basic-example></basic-example>
1212
</body>
1313
</html>

examples/angular/infinite-query-with-max-pages/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Angular Query infinite query example
1+
# TanStack Query Angular infinite query example
22

33
To run this example:
44

examples/angular/infinite-query-with-max-pages/angular.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"newProjectRoot": "projects",
1212
"projects": {
13-
"basic": {
13+
"infinite-query-with-max-pages": {
1414
"projectType": "application",
1515
"schematics": {
1616
"@schematics/angular:component": {
@@ -47,7 +47,7 @@
4747
"build": {
4848
"builder": "@angular-devkit/build-angular:application",
4949
"options": {
50-
"outputPath": "dist/basic",
50+
"outputPath": "dist/infinite-query-with-max-pages",
5151
"index": "src/index.html",
5252
"browser": "src/main.ts",
5353
"polyfills": ["zone.js"],
@@ -84,18 +84,18 @@
8484
"builder": "@angular-devkit/build-angular:dev-server",
8585
"configurations": {
8686
"production": {
87-
"buildTarget": "basic:build:production"
87+
"buildTarget": "infinite-query-with-max-pages:build:production"
8888
},
8989
"development": {
90-
"buildTarget": "basic:build:development"
90+
"buildTarget": "infinite-query-with-max-pages:build:development"
9191
}
9292
},
9393
"defaultConfiguration": "development"
9494
},
9595
"extract-i18n": {
9696
"builder": "@angular-devkit/build-angular:extract-i18n",
9797
"options": {
98-
"buildTarget": "basic:build"
98+
"buildTarget": "infinite-query-with-max-pages:build"
9999
}
100100
}
101101
}

examples/angular/infinite-query-with-max-pages/src/app/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import type { ApplicationConfig } from '@angular/core'
1212

1313
export const appConfig: ApplicationConfig = {
1414
providers: [
15-
provideHttpClient(withInterceptors([projectsMockInterceptor]), withFetch()),
1615
provideAngularQuery(
1716
new QueryClient({
1817
defaultOptions: {
@@ -22,5 +21,6 @@ export const appConfig: ApplicationConfig = {
2221
},
2322
}),
2423
),
24+
provideHttpClient(withInterceptors([projectsMockInterceptor]), withFetch()),
2525
],
2626
}

examples/angular/infinite-query-with-max-pages/src/app/components/example.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { AngularQueryDevtools } from '@tanstack/angular-query-devtools-experimen
88
import { injectInfiniteQuery } from '@tanstack/angular-query-experimental'
99
import { lastValueFrom } from 'rxjs'
1010
import { ProjectStyleDirective } from '../directives/project-style.directive'
11-
import { ProjectsService } from '../services/projects-service'
11+
import { ProjectsService } from '../services/projects.service'
1212

1313
@Component({
1414
changeDetection: ChangeDetectionStrategy.OnPush,

examples/angular/infinite-query-with-max-pages/src/app/services/projects-service.ts renamed to examples/angular/infinite-query-with-max-pages/src/app/services/projects.service.ts

File renamed without changes.

examples/angular/infinite-query-with-max-pages/src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>Angular Query infinite query example</title>
5+
<title>TanStack Query Angular infinite query example</title>
66
<base href="/" />
77
<meta name="viewport" content="width=device-width, initial-scale=1" />
88
<link rel="icon" type="image/x-icon" href="favicon.ico" />
99
</head>
1010
<body>
11-
<app-root />
11+
<app-root></app-root>
1212
</body>
1313
</html>

0 commit comments

Comments
 (0)