import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
const Parse = require('parse');
Parse.initialize("dev");// 骏登applicationId
Parse.serverURl ="http://web2023.fmode.cn:9999/parse";// 级serverURl
@Component({
  selector: 'app-search',
  templateUrl: './search.page.html',
  styleUrls: ['./search.page.scss'],
})
export class SearchPage implements OnInit {

  constructor(private route:ActivatedRoute)  {}
  

  ngOnInit() {
     this.loadPetById()
  }
  pet:Parse.Object|undefined
  async loadPetById(){
     //let id = location.pathname.split("/").pop();
    let id = this.route.snapshot.params["id"]
    if(id){
      let query = new Parse.Query("Pet");
      this.pet = await query.get(id);
    }
  }

}
