From 2cc6a83c18aec35e525883b89dd883c012ec6ff8 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Tue, 20 Oct 2026 12:03:49 +0900 Subject: [PATCH] docs(angular/overview): guard the error with 'isError()', rename the 'Response' interface to 'Repo', and remove the unused 'CommonModule' import --- docs/framework/angular/overview.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/framework/angular/overview.md b/docs/framework/angular/overview.md index 52041ab9ff9..ac71df931f1 100644 --- a/docs/framework/angular/overview.md +++ b/docs/framework/angular/overview.md @@ -63,7 +63,6 @@ In the example below, you can see TanStack Query in its most basic and simple fo ```angular-ts import { ChangeDetectionStrategy, Component, inject } from '@angular/core' import { HttpClient } from '@angular/common/http' -import { CommonModule } from '@angular/common' import { injectQuery } from '@tanstack/angular-query-experimental' import { lastValueFrom } from 'rxjs' @@ -74,7 +73,7 @@ import { lastValueFrom } from 'rxjs' @if (repoDataQuery.isPending()) { Loading... } - @if (repoDataQuery.error()) { + @if (repoDataQuery.isError()) { An error has occurred: {{ repoDataQuery.error().message }} } @if (repoDataQuery.data(); as data) { @@ -93,12 +92,12 @@ export class SimpleExampleComponent { queryKey: ['repoData'], queryFn: () => lastValueFrom( - this.http.get('https://api.github.com/repos/TanStack/query'), + this.http.get('https://api.github.com/repos/TanStack/query'), ), })) } -interface Response { +interface Repo { name: string description: string subscribers_count: number