* location service is now used to generate ravision.json url with base-href
This commit is contained in:
parent
f51b8090aa
commit
0cfa4acdb6
@ -1,6 +1,7 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {Http} from "@angular/http";
|
import {Http} from "@angular/http";
|
||||||
import {Observable} from "rxjs/Observable";
|
import {Observable} from "rxjs/Observable";
|
||||||
|
import {Location} from "@angular/common";
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -9,8 +10,10 @@ export class SelfUpdaterService {
|
|||||||
private appRevision: number = 0;
|
private appRevision: number = 0;
|
||||||
private initFailed: boolean = false;
|
private initFailed: boolean = false;
|
||||||
|
|
||||||
constructor(private httpService: Http) {
|
constructor(
|
||||||
console.log("init");
|
private httpService: Http,
|
||||||
|
private locationService: Location,
|
||||||
|
) {
|
||||||
this.getDeployedRevision().subscribe(
|
this.getDeployedRevision().subscribe(
|
||||||
result => this.appRevision = result,
|
result => this.appRevision = result,
|
||||||
() => {
|
() => {
|
||||||
@ -24,7 +27,7 @@ export class SelfUpdaterService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getDeployedRevision(): Observable<number> {
|
private getDeployedRevision(): Observable<number> {
|
||||||
return this.httpService.get("/revision.json").map(result => result.json());
|
return this.httpService.get(this.locationService.prepareExternalUrl("/revision.json")).map(result => result.json());
|
||||||
}
|
}
|
||||||
|
|
||||||
public checkAndReloadIfNecessary() {
|
public checkAndReloadIfNecessary() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user