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 { return this.http.get(this.actionUrl + 'getStatistics', { headers: this.headers }); } }