2019-10-24 09:44:29 +02:00
|
|
|
import {Injectable} from '@angular/core';
|
|
|
|
import {HttpClient} from "@angular/common/http";
|
|
|
|
import {Observable} from "rxjs";
|
2020-06-03 15:44:03 +02:00
|
|
|
import {SourceType} from "../../openaireLibrary/monitor/entities/stakeholder";
|
2020-11-13 17:42:12 +01:00
|
|
|
import {properties} from "../../../environments/environment";
|
2023-06-01 12:58:43 +02:00
|
|
|
import {IndicatorUtils} from "../indicator-utils";
|
2019-10-24 09:44:29 +02:00
|
|
|
|
|
|
|
|
2019-11-19 15:25:19 +01:00
|
|
|
@Injectable({
|
2023-06-01 12:58:43 +02:00
|
|
|
providedIn: 'root'
|
2019-11-19 15:25:19 +01:00
|
|
|
})
|
2019-10-24 09:44:29 +02:00
|
|
|
export class StatisticsService {
|
2023-06-01 12:58:43 +02:00
|
|
|
|
|
|
|
indicatorsUtils = new IndicatorUtils();
|
|
|
|
|
|
|
|
constructor(private http: HttpClient) {}
|
|
|
|
|
|
|
|
getNumbers(source: SourceType, url: string): Observable<any> {
|
|
|
|
if (source !== null) {
|
|
|
|
return this.http.get<any>(this.indicatorsUtils.getNumberUrl(source, url));
|
|
|
|
} else {
|
|
|
|
return this.http.get<any>(url);
|
2019-11-19 15:25:19 +01:00
|
|
|
}
|
2023-06-01 12:58:43 +02:00
|
|
|
}
|
2019-10-24 09:44:29 +02:00
|
|
|
}
|