{{ data[0].name }}
24 | } @if (todosSignal().isError) { 25 |Error
26 | } 27 | 28 |{{ result.data[0].name }}
33 | } @if (result.isError) { 34 |Error
35 | } } 36 | `, 37 | }) 38 | export class App { 39 | todos = AxiosQuery.Query.useFindPetsByStatusQuery({ 40 | status: [Status.Pending, Status.Sold], 41 | }); 42 | todosSignal = this.todos.result; 43 | } 44 | 45 | bootstrapApplication(App, { 46 | providers: [provideHttpClient()], 47 | }); 48 | -------------------------------------------------------------------------------- /examples/pet-client-angular/src/todos.service.ts: -------------------------------------------------------------------------------- 1 | import { HttpClient } from '@angular/common/http'; 2 | import { inject, Injectable } from '@angular/core'; 3 | import { 4 | injectMutation, 5 | injectQuery, 6 | injectQueryClient, 7 | QueryClient, 8 | } from '@ngneat/query'; 9 | 10 | interface Todo { 11 | id: number; 12 | title: string; 13 | } 14 | 15 | export function getToDos() { 16 | const m = injectMutation()({ 17 | mutationFn: async (d) => {}, 18 | }); 19 | const client2: QueryClient = injectQueryClient(); 20 | 21 | const r = injectQuery()<{ q: string }>({ 22 | queryKey: ['a'], 23 | queryFn: (x) => { 24 | return { 25 | q: 'qwe', 26 | }; 27 | }, 28 | }); 29 | 30 | return injectQuery()({ 31 | queryKey: ['todos'] as const, 32 | queryFn: () => { 33 | return inject(HttpClient).get