import { Component, inject, OnInit } from '@angular/core';
import { BookService } from '../services/book.service';
import { Book } from '../models/book';

@Component({
  selector: 'app-books',
  standalone: true,
  imports: [],
  templateUrl: './books.component.html',
  styleUrl: './books.component.css'
})
export class BooksComponent implements OnInit {

  allBooks: Book[] = []

  private bookService = inject(BookService) 

  ngOnInit(): void {
    this.bookService.getAll().subscribe(data=>{
      this.allBooks = data
    })
  }
  
}
