Project

General

Profile

« Previous | Next » 

Revision 58853

Working on the new version of the oso - almost done with tha data part of the pages

View differences:

data-view.component.ts
22 22
  tableAbsoluteData: CountryTableData[];
23 23
  tablePercentageData: CountryTableData[];
24 24

  
25
  loading: boolean = true;
25
  loadingAbsoluteTable: boolean = true;
26
  loadingPercentageTable: boolean = true;
26 27

  
27 28
  oaPublicationsURL: SafeResourceUrl;
28 29
  oaRepositoriesURL: SafeResourceUrl;
......
37 38

  
38 39
  ngOnInit(): void {
39 40
    this.getAbsoluteData();
41
    this.getPercentageData();
40 42
  }
41 43

  
42 44
  getAbsoluteData() {
43
    this.loading = true;
45
    this.loadingAbsoluteTable = true;
44 46
    this.dataService.getOverviewTableAbsoluteData(this.contentAbsoluteSelection).subscribe(
45 47
      rawData => {
46 48
        this.tableAbsoluteData = this.dataHandlerService.convertRawDataToAbsoluteTableData(rawData);
47
        this.loading = false;
49
        this.loadingAbsoluteTable = false;
48 50
      }, error => {
49 51
        console.log(error);
50
        this.loading = false;
52
        this.loadingAbsoluteTable = false;
51 53
      }
52 54
    );
53 55
  }
54 56

  
55 57
  getPercentageData() {
56
    this.loading = true;
57
    this.dataService.getOverviewTableAbsoluteData(this.contentPercentageSelection).subscribe(
58
    this.loadingPercentageTable = true;
59
    this.dataService.getOverviewTablePercentageData(this.contentPercentageSelection).subscribe(
58 60
      rawData => {
59
        this.tablePercentageData = this.dataHandlerService.convertRawDataToAbsoluteTableData(rawData);
60
        this.loading = false;
61
        this.tablePercentageData = this.dataHandlerService.convertRawDataToPercentageTableData(rawData);
62
        this.loadingPercentageTable = false;
61 63
      }, error => {
62 64
        console.log(error);
63
        this.loading = false;
65
        this.loadingPercentageTable = false;
64 66
      }
65 67
    );
66 68
  }

Also available in: Unified diff