diff --git a/src/app/books/book-list.component.ts b/src/app/books/book-list.component.ts index 71aa470..4e501ca 100644 --- a/src/app/books/book-list.component.ts +++ b/src/app/books/book-list.component.ts @@ -15,6 +15,9 @@ export class BookListComponent { computation: books => books[0] }); + // this also works (shorthand version) + // firstBook = linkedSignal(() => this.books()[0]); + overrideFirstBook() { // Manually updating `firstBook`, which now returns 'jQuery' this.firstBook.set('jQuery'); diff --git a/src/app/books/book/book.component.ts b/src/app/books/book/book.component.ts index 2886a1a..4f56f77 100644 --- a/src/app/books/book/book.component.ts +++ b/src/app/books/book/book.component.ts @@ -20,7 +20,6 @@ export class BookComponent { // this also works: // rating = linkedSignal(() => this.book().rating); - doRateUp() { const newRating = this.rating() + 1; this.rating.set(newRating);