From 0cfa4acdb6ca5551b1936c246ca566319c248ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Danyi?= Date: Wed, 23 Aug 2017 19:18:36 +0200 Subject: [PATCH] * location service is now used to generate ravision.json url with base-href --- src/app/kanban/shared/self-updater.service.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/kanban/shared/self-updater.service.ts b/src/app/kanban/shared/self-updater.service.ts index a1f3899..a3bdda0 100644 --- a/src/app/kanban/shared/self-updater.service.ts +++ b/src/app/kanban/shared/self-updater.service.ts @@ -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 { - 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() {