Open web-dave opened 2 months ago
book-details
book-preview
RoutParams
router = inject(Router); route = inject(ActivatedRoute); selectBook(book: IBook) { this.router.navigate([book.isbn], {relativeTo: this.route}); }
getOne(isbn: string) { return this.http.get<IBook>('http://localhost:4730/books/' + isbn); }
{ path: ':isbn', component: BookDetailsComponent }
NEXT
book-details
componentbook-preview
should bring you to thisbook-details
component (RoutParams
)book-list.component.ts
book.service.ts
book-details.component.ts
```ts this.route .params .subscribe((params) => { this.bookService.getOne(params['isbn']).subscribe(b => { this.book = b; }); }); ```book.routes.ts