35 lines
1006 B
TypeScript
35 lines
1006 B
TypeScript
import {Component, OnInit} from "@angular/core";
|
|
import {HelpContentService} from "../../services/help-content.service";
|
|
import {CommunityStatistics} from "../../domain/statistics-classes";
|
|
|
|
@Component({
|
|
selector: 'stats',
|
|
templateUrl: 'stats.component.html'
|
|
})
|
|
|
|
export class StatsComponent implements OnInit {
|
|
stats: CommunityStatistics;
|
|
tableNames: string[] = [];
|
|
|
|
|
|
constructor(private contentService: HelpContentService) {}
|
|
|
|
ngOnInit() {
|
|
this.getStatistics();
|
|
}
|
|
|
|
getStatistics() {
|
|
this.contentService.getStatistics('egi').subscribe(
|
|
stats => this.stats = stats,
|
|
error => console.log(error),
|
|
() => {
|
|
console.log(`I got something! My pid is ${this.stats.pid}`);
|
|
console.log(`my table names are:`);
|
|
for (let key in this.stats.statistics){
|
|
this.tableNames.push(key);
|
|
console.log(key);
|
|
}
|
|
}
|
|
);
|
|
}
|
|
} |