react-code-dataset / react-query /examples /angular /query-options-from-a-service /src /app /components /posts.component.ts
Download react-query/examples/angular/query-options-from-a-service/src/app/components/posts.component.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/query-options-from-a-service/src/app/components/posts.component.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/query-options-from-a-service/src/app/components/posts.component.ts
-
curl -L -o posts.component.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/query-options-from-a-service/src/app/components/posts.component.ts
617 Bytes
| import { ChangeDetectionStrategy, Component, inject } from '@angular/core' | |
| import { RouterLink } from '@angular/router' | |
| import { QueryClient, injectQuery } from '@tanstack/angular-query-experimental' | |
| import { QueriesService } from '../services/queries-service' | |
| ({ | |
| changeDetection: ChangeDetectionStrategy.OnPush, | |
| selector: 'posts', | |
| templateUrl: './posts.component.html', | |
| imports: [RouterLink], | |
| }) | |
| export default class PostsComponent { | |
| private readonly queries = inject(QueriesService) | |
| readonly postsQuery = injectQuery(() => this.queries.posts()) | |
| readonly queryClient = inject(QueryClient) | |
| } | |