Fix configuration loading
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
fd8025c674
commit
677608c14d
@ -1,5 +1,5 @@
|
||||
import {Inject, Injectable} from '@angular/core';
|
||||
import { Location } from '@angular/common';
|
||||
import { Location,PathLocationStrategy } from '@angular/common';
|
||||
import {HttpClient, HttpXhrBackend} from '@angular/common/http';
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
@ -22,7 +22,9 @@ export class AppConfig {
|
||||
}
|
||||
|
||||
public load(): Promise<any> {
|
||||
return this.httpClient.get(this.location.prepareExternalUrl('/configuration.json'))
|
||||
var url = this.location.prepareExternalUrl('/configuration.json');
|
||||
if(url.startsWith("#")) url='/configuration.json';
|
||||
return this.httpClient.get(url)
|
||||
.toPromise()
|
||||
.then(data => {
|
||||
this.config = data;
|
||||
|
Loading…
Reference in New Issue
Block a user