diff --git a/docs/framework/angular/guides/queries.md b/docs/framework/angular/guides/queries.md index bdb597828a..051d332bf8 100644 --- a/docs/framework/angular/guides/queries.md +++ b/docs/framework/angular/guides/queries.md @@ -20,7 +20,7 @@ replace: import { injectQuery } from '@tanstack/angular-query-experimental' export class TodosComponent { - readonly info = injectQuery(() => ({ + readonly todosQuery = injectQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodoList, })) @@ -44,13 +44,13 @@ todosQuery = injectQuery(() => ({ @Component({ selector: 'todos', template: ` - @if (todos.isPending()) { + @if (todosQuery.isPending()) { Loading... - } @else if (todos.isError()) { - Error: {{ todos.error()?.message }} + } @else if (todosQuery.isError()) { + Error: {{ todosQuery.error()?.message }} } @else { - @for (todo of todos.data(); track todo.id) { + @for (todo of todosQuery.data(); track todo.id) {
  • {{ todo.title }}
  • } @empty {
  • No todos found
  • @@ -59,7 +59,7 @@ todosQuery = injectQuery(() => ({ `, }) export class PostsComponent { - readonly todos = injectQuery(() => ({ + readonly todosQuery = injectQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodoList, })) @@ -76,17 +76,17 @@ If booleans aren't your thing, you can always use the `status` state as well: @Component({ selector: 'todos', template: ` - @switch (todos.status()) { + @switch (todosQuery.status()) { @case ('pending') { Loading... } @case ('error') { - Error: {{ todos.error()?.message }} + Error: {{ todosQuery.error()?.message }} } @default {