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

@Component({
  selector: 'app-admin',
  templateUrl: './admin.component.html',
  styleUrls: ['./admin.component.css']
})
export class AdminComponent {

  constructor(private bookS: BookService){}

  newBook: Book = new Book();

  addBook(){
    this.newBook.likes = 0;
    this.bookS.addBook(this.newBook).subscribe(
      data=>{
        if(data>0){
          alert("Dodato")
        }
      }
    )
  }

}
