Revision 58904
Added by Stefania Martziou almost 4 years ago
home.component.ts | ||
---|---|---|
1 |
import { Component, DoCheck, OnInit, ViewEncapsulation } from '@angular/core';
|
|
1 |
import { Component, OnInit } from '@angular/core';
|
|
2 | 2 |
import { DataService } from '../../services/data.service'; |
3 |
import { CountryOverview, OverviewData } from '../../domain/overview-data'; |
|
4 | 3 |
import {CountryOverviewData, EuropeData, SelectedCountry} from '../../domain/overview-map-data'; |
5 | 4 |
import {DataHandlerService} from '../../services/data-handler.service'; |
6 | 5 |
|
... | ... | |
11 | 10 |
|
12 | 11 |
export class HomeComponent implements OnInit { |
13 | 12 |
|
14 |
// overviewData: OverviewData; |
|
15 |
|
|
16 | 13 |
europeOverviewData: EuropeData; |
17 | 14 |
|
18 | 15 |
selectedCountry: SelectedCountry = null; |
19 | 16 |
selectedCountryData: CountryOverviewData = null; |
20 | 17 |
|
21 |
// countrySelectedName: string = null; |
|
22 |
// countrySelectedOverview: CountryOverview = null; |
|
18 |
leadingOpenScienceData: CountryOverviewData[]; |
|
23 | 19 |
|
24 | 20 |
constructor(private dataService: DataService, |
25 | 21 |
private dataHandlerService: DataHandlerService) { } |
... | ... | |
36 | 32 |
} |
37 | 33 |
); |
38 | 34 |
|
39 |
// this.dataService.getOverviewData().subscribe( |
|
40 |
// overviewData => { |
|
41 |
// this.overviewData = overviewData; |
|
42 |
// }, |
|
43 |
// error => { |
|
44 |
// console.log(error); |
|
45 |
// } |
|
46 |
// ); |
|
35 |
this.dataService.getLeadingOpenScienceMobileData().subscribe( |
|
36 |
rawData => { |
|
37 |
this.leadingOpenScienceData = this.dataHandlerService.convertRawDataToLeadingOpenScienceData(rawData); |
|
38 |
}, error => { |
|
39 |
console.log(error); |
|
40 |
} |
|
41 |
); |
|
47 | 42 |
} |
48 | 43 |
|
49 | 44 |
countrySelected(selectedCountry: SelectedCountry) { |
... | ... | |
57 | 52 |
console.log(error); |
58 | 53 |
} |
59 | 54 |
); |
60 |
|
|
61 |
|
|
62 |
// this.countrySelectedOverview = this.overviewData.countries.filter(x => x.country === this.selectedCountry.name)[0]; |
|
63 |
// console.log('Country selected overview: ', this.countrySelectedOverview); |
|
64 | 55 |
} |
65 | 56 |
|
66 | 57 |
deselectCountry() { |
67 |
|
|
68 | 58 |
this.selectedCountry = null; |
69 | 59 |
this.selectedCountryData = null; |
70 |
|
|
71 |
// this.countrySelectedName = null; |
|
72 |
// this.countrySelectedOverview = null; |
|
73 | 60 |
} |
74 | 61 |
} |
Also available in: Unified diff
Working on the new version of the oso - almost done with tha mobile version of the pages