import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import Parse from "parse";
@Component({
  selector: 'app-book-detail',
  templateUrl: './book-detail.page.html',
  styleUrls: ['./book-detail.page.scss'],
})
export class BookDetailPage implements OnInit {

  constructor(
    private route:ActivatedRoute
  ) { }

  ngOnInit() {
    this.loadNovelInformationById()
  }

  novel:Parse.Object|undefined
  async loadNovelInformationById(){
    // let id = location.pathname.split("/").pop();
    let id = this.route.snapshot.params["id"]

    if(id){
      let query = new Parse.Query("NovelInformation");
      this.novel = await query.get(id);
    }
  }
}
