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

@Component({
  selector: 'app-books',
  templateUrl: './books.component.html',
  styleUrls: ['./books.component.css']
})
export class BooksComponent implements OnInit {
  constructor(private bookService: BookService){

  }
  ngOnInit(): void {
    this.allBooks = this.bookService.getAllBooks()
  }
  allBooks: Book[] = []

  searchParam: string = ""

  search(){
    this.allBooks =
    this.bookService.findBooks(this.searchParam)
  }
}
