react-code-dataset / react-query /examples /angular /router /src /app /components /posts.component.html
Download react-query/examples/angular/router/src/app/components/posts.component.html from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 890 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/router/src/app/components/posts.component.html
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/router/src/app/components/posts.component.html
-
curl -L -o posts.component.html https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/router/src/app/components/posts.component.html
890 Bytes
| <div> | |
| <h1>Posts</h1> | |
| @if (postsQuery.isPending()) { | |
| Loading... | |
| } @else if (postsQuery.isError()) { | |
| Error: {{ postsQuery.error().message }} | |
| } @else if (postsQuery.isSuccess()) { | |
| <div class="todo-container"> | |
| @for (post of postsQuery.data(); track post.id) { | |
| <p> | |
| <!-- We can access the query data here to show bold links for--> | |
| <!-- ones that are cached--> | |
| <a | |
| routerLink="post/{{ post.id }}" | |
| [style]=" | |
| queryClient.getQueryData(['post', post.id]) | |
| ? { | |
| fontWeight: 'bold', | |
| color: 'green', | |
| } | |
| : {} | |
| " | |
| >{{ post.title }}</a | |
| > | |
| </p> | |
| } | |
| </div> | |
| } | |
| <div> | |
| @if (postsQuery.isFetching()) { | |
| Background Updating... | |
| } | |
| </div> | |
| </div> | |