From 9d468c2b703f963063d09ae9b4df78815b7dc628 Mon Sep 17 00:00:00 2001 From: Arnoud de Vries <6420061+arnoud-dv@users.noreply.github.com> Date: Thu, 3 Oct 2024 23:33:40 +0200 Subject: [PATCH] docs(angular-query): add pagination example --- docs/config.json | 4 + examples/angular/basic/README.md | 2 +- examples/angular/basic/src/app/app.config.ts | 2 +- examples/angular/basic/src/index.html | 2 +- .../infinite-query-with-max-pages/README.md | 2 +- .../angular.json | 10 +- .../src/app/app.config.ts | 2 +- .../src/app/components/example.component.ts | 2 +- ...rojects-service.ts => projects.service.ts} | 0 .../src/index.html | 4 +- examples/angular/pagination/README.md | 6 + examples/angular/pagination/angular.json | 104 +++++++++++++++ examples/angular/pagination/package.json | 29 ++++ .../src/app/api/projects-mock.interceptor.ts | 40 ++++++ .../pagination/src/app/app.component.ts | 12 ++ .../angular/pagination/src/app/app.config.ts | 18 +++ .../src/app/components/example.component.html | 40 ++++++ .../src/app/components/example.component.ts | 66 +++++++++ .../src/app/services/projects.service.ts | 23 ++++ examples/angular/pagination/src/favicon.ico | Bin 0 -> 15086 bytes examples/angular/pagination/src/index.html | 13 ++ examples/angular/pagination/src/main.ts | 6 + examples/angular/pagination/tsconfig.app.json | 14 ++ examples/angular/pagination/tsconfig.json | 29 ++++ examples/angular/router/README.md | 2 +- examples/angular/rxjs/angular.json | 10 +- examples/angular/rxjs/src/index.html | 2 +- examples/angular/simple/README.md | 2 +- examples/angular/simple/src/app/app.config.ts | 2 +- pnpm-lock.yaml | 126 +++++++++++++++--- 30 files changed, 533 insertions(+), 41 deletions(-) rename examples/angular/infinite-query-with-max-pages/src/app/services/{projects-service.ts => projects.service.ts} (100%) create mode 100644 examples/angular/pagination/README.md create mode 100644 examples/angular/pagination/angular.json create mode 100644 examples/angular/pagination/package.json create mode 100644 examples/angular/pagination/src/app/api/projects-mock.interceptor.ts create mode 100644 examples/angular/pagination/src/app/app.component.ts create mode 100644 examples/angular/pagination/src/app/app.config.ts create mode 100644 examples/angular/pagination/src/app/components/example.component.html create mode 100644 examples/angular/pagination/src/app/components/example.component.ts create mode 100644 examples/angular/pagination/src/app/services/projects.service.ts create mode 100644 examples/angular/pagination/src/favicon.ico create mode 100644 examples/angular/pagination/src/index.html create mode 100644 examples/angular/pagination/src/main.ts create mode 100644 examples/angular/pagination/tsconfig.app.json create mode 100644 examples/angular/pagination/tsconfig.json diff --git a/docs/config.json b/docs/config.json index 11a32c4323..cd66f9889e 100644 --- a/docs/config.json +++ b/docs/config.json @@ -1038,6 +1038,10 @@ "label": "Basic", "to": "framework/angular/examples/basic" }, + { + "label": "Pagination", + "to": "framework/angular/examples/pagination" + }, { "label": "Infinite query with Max pages", "to": "framework/angular/examples/infinite-query-with-max-pages" diff --git a/examples/angular/basic/README.md b/examples/angular/basic/README.md index 091e861860..15f2ed2f4a 100644 --- a/examples/angular/basic/README.md +++ b/examples/angular/basic/README.md @@ -1,4 +1,4 @@ -# Angular Query basic example +# TanStack Query Angular basic example To run this example: diff --git a/examples/angular/basic/src/app/app.config.ts b/examples/angular/basic/src/app/app.config.ts index db56fd38d5..75b2b84870 100644 --- a/examples/angular/basic/src/app/app.config.ts +++ b/examples/angular/basic/src/app/app.config.ts @@ -7,7 +7,6 @@ import type { ApplicationConfig } from '@angular/core' export const appConfig: ApplicationConfig = { providers: [ - provideHttpClient(withFetch()), provideAngularQuery( new QueryClient({ defaultOptions: { @@ -17,5 +16,6 @@ export const appConfig: ApplicationConfig = { }, }), ), + provideHttpClient(withFetch()), ], } diff --git a/examples/angular/basic/src/index.html b/examples/angular/basic/src/index.html index 53168b1751..0ca80dd67a 100644 --- a/examples/angular/basic/src/index.html +++ b/examples/angular/basic/src/index.html @@ -8,6 +8,6 @@
-