|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@let b = book();
|
| 2 |
+
|
| 3 |
+
<article class="book-card">
|
| 4 |
+
<img [src]="b.imageUrl" alt="Cover" />
|
| 5 |
+
<header>
|
| 6 |
+
<h2>{{ b.title }}</h2>
|
| 7 |
+
</header>
|
| 8 |
+
<div>
|
| 9 |
+
@if (b.subtitle) {
|
| 10 |
+
<p role="doc-subtitle">{{ b.subtitle }}</p>
|
| 11 |
+
}
|
| 12 |
+
ISBN: {{ b.isbn }}
|
| 13 |
+
</div>
|
| 14 |
+
</article>
|
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Component, input } from '@angular/core';
|
| 2 |
+
|
| 3 |
+
import { Book } from '../../shared/book';
|
| 4 |
+
|
| 5 |
+
@Component({
|
| 6 |
+
selector: 'app-book-card',
|
| 7 |
+
imports: [],
|
| 8 |
+
templateUrl: './book-card.html',
|
| 9 |
+
styleUrl: './book-card.scss'
|
| 10 |
+
})
|
| 11 |
+
export class BookCard {
|
| 12 |
+
readonly book = input.required<Book>();
|
| 13 |
+
}
|
|
@@ -2,17 +2,7 @@
|
|
| 2 |
<h1>Books</h1>
|
| 3 |
<div>
|
| 4 |
@for (b of books(); track b.isbn) {
|
| 5 |
-
<
|
| 6 |
-
<header>
|
| 7 |
-
<h2>{{ b.title }}</h2>
|
| 8 |
-
</header>
|
| 9 |
-
<div>
|
| 10 |
-
@if (b.subtitle) {
|
| 11 |
-
<p role="doc-subtitle">{{ b.subtitle }}</p>
|
| 12 |
-
}
|
| 13 |
-
ISBN: {{ b.isbn }}
|
| 14 |
-
</div>
|
| 15 |
-
</article>
|
| 16 |
}
|
| 17 |
</div>
|
| 18 |
</section>
|
|
|
|
| 2 |
<h1>Books</h1>
|
| 3 |
<div>
|
| 4 |
@for (b of books(); track b.isbn) {
|
| 5 |
+
<app-book-card [book]="b" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
}
|
| 7 |
</div>
|
| 8 |
</section>
|
|
@@ -1,10 +1,11 @@
|
|
| 1 |
import { Component, signal } from '@angular/core';
|
| 2 |
|
| 3 |
import { Book } from '../../shared/book';
|
|
|
|
| 4 |
|
| 5 |
@Component({
|
| 6 |
selector: 'app-books-overview-page',
|
| 7 |
-
imports: [],
|
| 8 |
templateUrl: './books-overview-page.html',
|
| 9 |
styleUrl: './books-overview-page.scss',
|
| 10 |
})
|
|
|
|
| 1 |
import { Component, signal } from '@angular/core';
|
| 2 |
|
| 3 |
import { Book } from '../../shared/book';
|
| 4 |
+
import { BookCard } from '../book-card/book-card';
|
| 5 |
|
| 6 |
@Component({
|
| 7 |
selector: 'app-books-overview-page',
|
| 8 |
+
imports: [BookCard],
|
| 9 |
templateUrl: './books-overview-page.html',
|
| 10 |
styleUrl: './books-overview-page.scss',
|
| 11 |
})
|