cache busting for translation files (#2804)

This commit is contained in:
Denys Vuika
2018-01-05 21:23:41 +00:00
committed by Eugenio Romano
parent 96311c669a
commit f9fb7dc7dd

View File

@@ -60,8 +60,10 @@ export class TranslateLoaderService implements TranslateLoader {
if (!this.isComponentInQueue(lang, component.name)) { if (!this.isComponentInQueue(lang, component.name)) {
this.queue[lang].push(component.name); this.queue[lang].push(component.name);
let currentObserv = Observable.create(observer => { const loader = Observable.create(observer => {
this.http.get(`${component.path}/${this.prefix}/${lang}${this.suffix}`) const translationUrl = `${component.path}/${this.prefix}/${lang}${this.suffix}?v=${Date.now()}`;
this.http.get(translationUrl)
.map((res: Response) => { .map((res: Response) => {
component.json[lang] = res; component.json[lang] = res;
}).subscribe((result) => { }).subscribe((result) => {
@@ -73,7 +75,7 @@ export class TranslateLoaderService implements TranslateLoader {
}); });
}); });
observableBatch.push(currentObserv); observableBatch.push(loader);
} }
}); });