fengxiang
2018-07-11 12b04f145bae740e1971036b1e2dfc1bc224d17b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { NzMessageService, NzModalRef } from 'ng-zorro-antd';
import { HttpClient } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { _HttpClient } from '@delon/theme';
 
@Component({
  selector: 'app-extras-poi-edit',
  templateUrl: './edit.component.html',
})
export class ExtrasPoiEditComponent implements OnInit {
  i: any;
  cat: string[] = ['美食', '美食,粤菜', '美食,粤菜,湛江菜'];
 
  constructor(
    private modal: NzModalRef,
    public msgSrv: NzMessageService,
    public http: _HttpClient,
  ) {}
 
  ngOnInit() {
    if (this.i.id > 0) {
      this.http
        .get('./assets/tmp/pois.json')
        .subscribe((res: any) => (this.i = res.data[0]));
    }
  }
 
  save() {
    this.http.get('./assets/tmp/pois.json').subscribe(() => {
      this.msgSrv.success('保存成功,只是模拟,实际未变更');
      this.modal.close(true);
      this.close();
    });
  }
 
  close() {
    this.modal.destroy();
  }
}