Revision 52995
Added by Myrto Koukouli over 5 years ago
landing.component.ts | ||
---|---|---|
1 | 1 |
import {AuthenticationService} from "../../services/authentication.service"; |
2 | 2 |
import {Component, OnInit} from "@angular/core"; |
3 | 3 |
import {Router} from "@angular/router"; |
4 |
import { StatisticsService } from '../../services/statistics.service'; |
|
4 | 5 |
|
5 | 6 |
@Component ({ |
6 | 7 |
selector: 'landing', |
... | ... | |
9 | 10 |
|
10 | 11 |
export class LandingComponent implements OnInit { |
11 | 12 |
|
12 |
constructor(private authService: AuthenticationService, private router: Router) { } |
|
13 |
statisticsNumbers: Map<string,string>; |
|
14 |
inBeta: boolean; |
|
13 | 15 |
|
16 |
constructor(private authService: AuthenticationService, |
|
17 |
private statsService: StatisticsService, |
|
18 |
private router: Router) { } |
|
19 |
|
|
14 | 20 |
ngOnInit() { |
21 |
this.getStatisticsNumbers(); |
|
22 |
|
|
23 |
const baseUrl = window.location.origin; |
|
24 |
this.inBeta = ( baseUrl.includes('beta') || baseUrl.includes('athenarc') ); |
|
15 | 25 |
} |
16 | 26 |
|
17 | 27 |
|
... | ... | |
19 | 29 |
this.authService.loginWithState(); |
20 | 30 |
} |
21 | 31 |
|
32 |
getStatisticsNumbers() { |
|
33 |
this.statsService.getStatisticsNumbers().subscribe( |
|
34 |
res => this.statisticsNumbers = res, |
|
35 |
error => console.log(error), |
|
36 |
() => console.log(JSON.stringify(this.statisticsNumbers)) |
|
37 |
); |
|
38 |
} |
|
39 |
|
|
22 | 40 |
onStartHerePush() { |
23 | 41 |
this.router.navigate(['/dashboard']); |
24 | 42 |
} |
Also available in: Unified diff
almost ready for release