summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/test/test.component.ts
blob: e217919f3b2998e92c06b2eebf9526e6d419ed36 (plain)
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
40
41
42
43
44
45
46
47
import { Component, OnInit } from '@angular/core';
import { TextService } from '../core/services/text.service';

@Component({
  selector: 'app-test',
  templateUrl: './test.component.html',
  styleUrls: ['./test.component.less']
})
export class TestComponent implements OnInit {
  constructor(
    private TextService: TextService,
  ) {
  }

  ngOnInit() {
    this.getMockData();
    this.getjsonData();
    this.getCurrentLanguage();
    this.createPostData();

  }
  tableData = []
  getMockData() {
    this.TextService.getfakeData().subscribe(res => {
      console.log(res, "======fake data")
      this.tableData = res;
    })
  }
  getjsonData() {
    this.TextService.getjsonData("xuran").subscribe(res => {
      console.log(res, "======json data")
    })
  }
  getCurrentLanguage() {
    this.TextService.getCurrentLanguage(10).subscribe(res => {
      console.log(res, "======> current language")
    })
  }
  createPostData() {
    this.TextService.getCreatensData("/upload/name", { user: "xuran" }).subscribe(res => {
      console.log(res, "======> post data")
    })
  }



}