import { QueryClient, injectQuery } from '@tanstack/angular-query-experimental' import { HttpClient } from '@angular/common/http' class ServiceOrComponent { query = injectQuery(() => ({ queryKey: ['repoData'], queryFn: () => this.#http.get('https://api.github.com/repos/tanstack/query'), // $ Source })) #http: { get: (url: string) => Promise }; constructor(http: HttpClient) { this.#http = http; } displayRepoDetails() { this.query.data.then(response => { document.getElementById('repoInfo').innerHTML = response.description; // $ Alert const detailsElement = document.createElement('div'); detailsElement.innerHTML = `

${response.name}

${response.owner.bio}

`; // $ Alert document.body.appendChild(detailsElement); }); } } interface Response { name: string; description: string; stargazers_count: number; owner: { bio: string; } }