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