From 7476e4c92898264f5a1c49756a57120e8b67750a Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Mon, 11 Nov 2019 17:38:49 +0100 Subject: [PATCH] Set configuration correctly --- projects/common/src/fm/shared/app.config.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/common/src/fm/shared/app.config.ts b/projects/common/src/fm/shared/app.config.ts index 57fbc35..8a8104a 100644 --- a/projects/common/src/fm/shared/app.config.ts +++ b/projects/common/src/fm/shared/app.config.ts @@ -1,4 +1,5 @@ import {Inject, Injectable} from '@angular/core'; +import { Location } from '@angular/common'; import {HttpClient, HttpXhrBackend} from '@angular/common/http'; import {Observable} from 'rxjs'; @@ -8,7 +9,7 @@ export class AppConfig { private config: Object = null; private httpClient: HttpClient; - constructor(xhrBackend: HttpXhrBackend) { + constructor(xhrBackend: HttpXhrBackend,private location:Location) { this.httpClient = new HttpClient(xhrBackend); this.config = null; } @@ -21,7 +22,7 @@ export class AppConfig { } public load(): Promise { - return this.httpClient.get('/configuration.json') + return this.httpClient.get(this.location.prepareExternalUrl('/configuration.json')) .toPromise() .then(data => { this.config = data;