react-code-dataset / react-query /examples /angular /infinite-query-with-max-pages /src /app /components /example.component.html
Download react-query/examples/angular/infinite-query-with-max-pages/src/app/components/example.component.html from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 953 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/infinite-query-with-max-pages/src/app/components/example.component.html
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/infinite-query-with-max-pages/src/app/components/example.component.html
-
curl -L -o example.component.html https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/infinite-query-with-max-pages/src/app/components/example.component.html
953 Bytes
| <div> | |
| <h1>Infinite Query with max pages</h1> | |
| <h3>4 projects per page</h3> | |
| <h3>3 pages max</h3> | |
| @if (query.isPending()) { | |
| <p>Loading...</p> | |
| } @else if (query.isError()) { | |
| <span>Error: {{ query.error().message }}</span> | |
| } @else { | |
| <div> | |
| <button | |
| (click)="query.fetchPreviousPage()" | |
| [disabled]="previousButtonDisabled()" | |
| > | |
| {{ previousButtonText() }} | |
| </button> | |
| </div> | |
| @for (page of query.data().pages; track $index) { | |
| @for (project of page.data; track project.id) { | |
| <p [projectStyle]="project.id">{{ project.name }} {{ project.id }}</p> | |
| } | |
| } | |
| <div> | |
| <button (click)="query.fetchNextPage()" [disabled]="nextButtonDisabled()"> | |
| {{ nextButtonText() }} | |
| </button> | |
| </div> | |
| <div> | |
| {{ | |
| query.isFetching() && !query.isFetchingNextPage() | |
| ? 'Background Updating...' | |
| : null | |
| }} | |
| </div> | |
| } | |
| <hr /> | |
| </div> | |