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

36 lines
1.4 KiB
TypeScript

import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { ServerService } from '../../app/services/server.service';
import { DashboardService } from '../../app/services/dashboard/dashboard.service';
import { DashboardStatisticsModel } from '../models/dashboard/DashboardStatisticsModel';
import { JsonSerializer } from '../utilities/JsonSerializer';
import { DatasetListingComponent } from '../../app/datasets_new/dataset-listing.component';
@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 serverService: ServerService, 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 = new JsonSerializer<DashboardStatisticsModel>().fromJSONObject(results,DashboardStatisticsModel);
})
}
}