137b2ab1fc
Reviewed-on: #3 Co-authored-by: sandre <perso@sebastienandre.com> Co-committed-by: sandre <perso@sebastienandre.com>
26 lines
692 B
TypeScript
26 lines
692 B
TypeScript
import { HttpHeaders } from "@angular/common/http";
|
|
|
|
import { ConfigurationHelper } from "./configuration-helper";
|
|
import { ServiceCacheApi } from "./service-cache-api.service";
|
|
|
|
export class BaseService {
|
|
protected headers: HttpHeaders;
|
|
protected apiUrl: string;
|
|
protected serviceCacheApi: ServiceCacheApi;
|
|
|
|
constructor() {
|
|
ConfigurationHelper.settings.subscribe((settings) => {
|
|
if (settings != null) {
|
|
let tmpApiUrl: string = settings.apiUrl;
|
|
|
|
this.headers = new HttpHeaders({
|
|
"Access-Control-Allow-Origin": tmpApiUrl,
|
|
});
|
|
this.apiUrl = tmpApiUrl + "/api";
|
|
}
|
|
});
|
|
|
|
this.serviceCacheApi = new ServiceCacheApi();
|
|
}
|
|
}
|