From 457cbfead4a403cf2ccc3c3c2846bd5ccf0bb0c4 Mon Sep 17 00:00:00 2001 From: sumeyye Date: Thu, 5 Nov 2026 11:19:06 +0300 Subject: [PATCH] docs(book-store): part-10 fix Angular book component snippet (inject import, this.bookService) Co-Authored-By: Claude Sonnet 5.5 --- docs/en/tutorials/book-store/part-10.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/tutorials/book-store/part-10.md b/docs/en/tutorials/book-store/part-10.md index b6db244598..487d2aa732 100644 --- a/docs/en/tutorials/book-store/part-10.md +++ b/docs/en/tutorials/book-store/part-10.md @@ -990,7 +990,7 @@ Open the `/src/app/book/book.component.ts` and and change the content as shown b ````js import { ListService, PagedResultDto } from '@abp/ng.core'; -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, inject } from '@angular/core'; import { BookService, BookDto, bookTypeOptions, AuthorLookupDto } from '@proxy/books'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { NgbDateNativeAdapter, NgbDateAdapter } from '@ng-bootstrap/ng-bootstrap'; @@ -1023,7 +1023,7 @@ export class BookComponent implements OnInit { private readonly confirmation = inject(ConfirmationService); constructor() { - this.authors$ = bookService.getAuthorLookup().pipe(map((r) => r.items)); + this.authors$ = this.bookService.getAuthorLookup().pipe(map((r) => r.items)); } ngOnInit() { @@ -1089,7 +1089,7 @@ export class BookComponent implements OnInit { * Added imports for the `AuthorLookupDto`, `Observable` and `map`. * Added `authors$: Observable;` field after the `selectedBook`. -* Added `this.authors$ = bookService.getAuthorLookup().pipe(map((r) => r.items));` into the constructor. +* Added `this.authors$ = this.bookService.getAuthorLookup().pipe(map((r) => r.items));` into the constructor. * Added ` authorId: [this.selectedBook.authorId || null, Validators.required],` into the `buildForm()` function. Open the `/src/app/book/book.component.html` and add the following form group just before the book name form group: