argos/dmp-frontend/src/app/homepage/homepage.component.ts

38 lines
1.2 KiB
TypeScript
Raw Normal View History

2017-11-16 18:07:27 +01:00
import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
2017-12-15 12:52:11 +01:00
import { DashboardService } from '../../app/services/dashboard/dashboard.service';
import { DashboardStatisticsModel } from '../models/dashboard/DashboardStatisticsModel';
import { JsonSerializer } from '../utilities/JsonSerializer';
@Component({
selector: 'homepage',
templateUrl: './homepage.component.html',
styleUrls: ['./homepage.component.css'],
2017-12-19 18:34:00 +01:00
providers: []
})
2017-12-19 18:34:00 +01:00
export class HomepageComponent implements OnInit {
2017-11-16 18:07:27 +01:00
private userInfo: any;
2017-12-19 18:34:00 +01:00
private dashboardStatisticsData: DashboardStatisticsModel = new DashboardStatisticsModel();
constructor(
private route: ActivatedRoute,
private router: Router,
private dashBoardService: DashboardService
) {
2017-12-15 12:52:11 +01:00
this.dashboardStatisticsData.totalDataManagementPlanCount = 0;
this.dashboardStatisticsData.totalDataSetCount = 0;
this.dashboardStatisticsData.totalProjectCount = 0;
2017-11-16 18:07:27 +01:00
}
2017-12-19 18:34:00 +01:00
ngOnInit() {
this.dashBoardService.getStatistics().subscribe(results => {
2017-12-19 09:20:35 +01:00
//let data = results['payload'];
2018-01-03 17:36:31 +01:00
this.dashboardStatisticsData = JsonSerializer.fromJSONObject(results, DashboardStatisticsModel);
2017-12-15 12:52:11 +01:00
})
2017-11-16 18:07:27 +01:00
2017-12-14 17:43:57 +01:00
}
2017-11-16 18:07:27 +01:00
}