1 |
50186
|
myrto.kouk
|
import { Component, Input, OnInit } from '@angular/core';
|
2 |
|
|
import { ActivatedRoute } from '@angular/router';
|
3 |
|
|
import { PiwikInfo } from '../../domain/typeScriptClasses';
|
4 |
|
|
import { RepositoryService } from '../../services/repository.service';
|
5 |
|
|
|
6 |
|
|
@Component ({
|
7 |
|
|
selector: 'metrics-show',
|
8 |
|
|
templateUrl: 'metrics-show.component.html'
|
9 |
|
|
})
|
10 |
|
|
|
11 |
|
|
export class MetricsShowComponent implements OnInit {
|
12 |
50216
|
myrto.kouk
|
piwik: PiwikInfo;
|
13 |
50186
|
myrto.kouk
|
|
14 |
|
|
constructor(
|
15 |
|
|
private route: ActivatedRoute,
|
16 |
|
|
private repoService: RepositoryService
|
17 |
|
|
) {}
|
18 |
|
|
|
19 |
|
|
ngOnInit() {
|
20 |
|
|
this.getPiwik();
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
getPiwik(): void {
|
24 |
|
|
let id = this.route.snapshot.paramMap.get('id');
|
25 |
|
|
this.repoService.getPiwikInfo(id).subscribe(
|
26 |
|
|
piwik => this.piwik = piwik,
|
27 |
|
|
error => console.log(error)
|
28 |
|
|
);
|
29 |
|
|
}
|
30 |
|
|
|
31 |
|
|
}
|