Open web-dave opened 4 months ago
BookPreview
ng g c books/book-preview
Input
Output
export class BookPreviewComponent { @Input() book: any; @Output() bookSelected = new EventEmitter(); }
<strong>{{ book.title }}</strong> <br /> <small>{{ book.subtitle }}</small>
book-preview
@for (book of books; track $index) { <app-book-preview [book]="book" /> }
book-list
showMore() { this.bookSelected.emit(this.book); }
NEXT
BookPreview
Componentng g c books/book-preview
Input
and aOutput
book-preview.component.ts
book-preview.component.html
book-preview.component.scss
```scss @import "../../../utils"; :host { display: block; @include object(100%, 60px, $aqua); border-radius: 90px; margin-top: 10px; padding-left: 45px; padding-top: 10px; } ```book-preview
in book-list templatebook-list.component.html
book-preview
tobook-list
book-preview.component.ts
book-preview.component.html
```html ```book-list.component.ts
```ts selectBook(e: any) { console.log(e); } ```book-list.component.html
```html