argos/dmp-frontend/src/app/services/dashboard/dashboard.service.ts

32 lines
1.0 KiB
TypeScript
Raw Normal View History

2017-12-15 12:52:11 +01:00
import 'rxjs/add/operator/map';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { HostConfiguration } from './../../app.constants';
import { BaseHttpService } from '../../utilities/cite-http-service-module/base-http.service';
import { Observable } from 'rxjs/Observable';
import { DashboardStatisticsModel } from '../../models/dashboard/DashboardStatisticsModel';
@Injectable()
export class DashboardService {
private actionUrl: string;
private headers: HttpHeaders;
constructor(private http: BaseHttpService) {
this.actionUrl = HostConfiguration.Server + 'dashboard/';
this.headers = new HttpHeaders();
this.headers = this.headers.set('Content-Type', 'application/json');
this.headers = this.headers.set('Accept', 'application/json');
}
getStatistics(): Observable<DashboardStatisticsModel> {
return this.http.get<DashboardStatisticsModel>(this.actionUrl + 'getStatistics', { headers: this.headers });
}
}