* 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 {Http} from "@angular/http";
|
||||
import {Observable} from "rxjs/Observable";
|
||||
import {Location} from "@angular/common";
|
||||
|
||||
|
||||
@Injectable()
|
||||
@ -9,8 +10,10 @@ export class SelfUpdaterService {
|
||||
private appRevision: number = 0;
|
||||
private initFailed: boolean = false;
|
||||
|
||||
constructor(private httpService: Http) {
|
||||
console.log("init");
|
||||
constructor(
|
||||
private httpService: Http,
|
||||
private locationService: Location,
|
||||
) {
|
||||
this.getDeployedRevision().subscribe(
|
||||
result => this.appRevision = result,
|
||||
() => {
|
||||
@ -24,7 +27,7 @@ export class SelfUpdaterService {
|
||||
}
|
||||
|
||||
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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user