38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
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'],
|
|
providers: []
|
|
})
|
|
export class HomepageComponent implements OnInit {
|
|
|
|
private userInfo: any;
|
|
private dashboardStatisticsData: DashboardStatisticsModel = new DashboardStatisticsModel();
|
|
|
|
constructor(
|
|
private route: ActivatedRoute,
|
|
private router: Router,
|
|
private dashBoardService: DashboardService
|
|
) {
|
|
this.dashboardStatisticsData.totalDataManagementPlanCount = 0;
|
|
this.dashboardStatisticsData.totalDataSetCount = 0;
|
|
this.dashboardStatisticsData.totalProjectCount = 0;
|
|
}
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.dashBoardService.getStatistics().subscribe(results => {
|
|
//let data = results['payload'];
|
|
this.dashboardStatisticsData = JsonSerializer.fromJSONObject(results, DashboardStatisticsModel);
|
|
})
|
|
|
|
}
|
|
|
|
} |