import { Component } from '@angular/core';
// 引入服务
import { ActivatedRoute } from '@angular/router';

// 引入Parse第三方库
import * as Parse from "parse"
(Parse as any).serverURL = "http://metapunk.cn:9999/parse"
Parse.initialize("dev")

@Component({
  selector: 'app-they-detail',
  templateUrl: './they-detail.component.html',
  styleUrls: ['./they-detail.component.scss']
})
export class TheyDetailComponent {
  //预设值变量
  they: Parse.Object | undefined;
  // 依赖注入
  constructor(private route: ActivatedRoute) {
    // 查询参数获取并赋值给this.htey
    this.route.queryParams.subscribe(params => {
      this.getTheyById(params["id"])
    })
  }
  async getTheyById(id: string) {
    let query = new Parse.Query("SqzPerson")
    this.they = await query.get(id)
  }
}
