Set configuration correctly
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/develop This commit looks good
This commit is contained in:
parent
d5258b7c79
commit
7476e4c928
@ -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<any> {
|
||||
return this.httpClient.get('/configuration.json')
|
||||
return this.httpClient.get(this.location.prepareExternalUrl('/configuration.json'))
|
||||
.toPromise()
|
||||
.then(data => {
|
||||
this.config = data;
|
||||
|
Loading…
Reference in New Issue
Block a user