28 lines
816 B
TypeScript
28 lines
816 B
TypeScript
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
import { OverviewData } from '../domain/overview-data';
|
|
|
|
const headerOptions = {
|
|
headers : new HttpHeaders().set('Content-Type', 'application/json')
|
|
.set('Accept', 'application/json'),
|
|
};
|
|
|
|
@Injectable ()
|
|
export class DataService {
|
|
// private _jsonURl = environment.API_ENDPOINT + '/monitor/';
|
|
// private _jsonURl = '/assets/json/';
|
|
private _jsonURl = 'http://esperos.di.uoa.gr/oss.json';
|
|
|
|
constructor(private httpClient: HttpClient) {
|
|
}
|
|
|
|
public getOverviewData(): Observable<OverviewData> {
|
|
return this.httpClient.get<OverviewData>(this._jsonURl, headerOptions);
|
|
}
|
|
|
|
// public getOverviewData(): Observable<OverviewData> {
|
|
// return ;
|
|
// }
|
|
}
|