diff --git a/projects/ngx-translate/http-loader/src/lib/http-loader.ts b/projects/ngx-translate/http-loader/src/lib/http-loader.ts index 0afd4a9..ea92777 100644 --- a/projects/ngx-translate/http-loader/src/lib/http-loader.ts +++ b/projects/ngx-translate/http-loader/src/lib/http-loader.ts @@ -3,7 +3,7 @@ import {TranslateLoader} from "@ngx-translate/core"; import {Observable} from 'rxjs'; export class TranslateHttpLoader implements TranslateLoader { - constructor(private http: HttpClient, public prefix: string = "/assets/i18n/", public suffix: string = ".json") {} + constructor(private http: HttpClient, public prefix: string = "./assets/i18n/", public suffix: string = ".json") {} /** * Gets the translations from the server diff --git a/projects/ngx-translate/http-loader/tests/http-loader.spec.ts b/projects/ngx-translate/http-loader/tests/http-loader.spec.ts index 7ca061b..19481ff 100644 --- a/projects/ngx-translate/http-loader/tests/http-loader.spec.ts +++ b/projects/ngx-translate/http-loader/tests/http-loader.spec.ts @@ -46,7 +46,7 @@ describe('TranslateLoader', () => { }); // mock response after the xhr request, otherwise it will be undefined - http.expectOne('/assets/i18n/en.json').flush({ + http.expectOne('./assets/i18n/en.json').flush({ "TEST": "This is a test", "TEST2": "This is another test" }); @@ -69,11 +69,11 @@ describe('TranslateLoader', () => { expect(translate.instant('TEST')).toEqual('This is a test 2'); }); - http.expectOne('/assets/i18n/en.json').flush({"TEST": "This is a test 2"}); + http.expectOne('./assets/i18n/en.json').flush({"TEST": "This is a test 2"}); }); // mock response after the xhr request, otherwise it will be undefined - http.expectOne('/assets/i18n/en.json').flush({"TEST": "This is a test"}); + http.expectOne('./assets/i18n/en.json').flush({"TEST": "This is a test"}); }); it('should be able to reset a lang', (done: Function) => { @@ -101,6 +101,6 @@ describe('TranslateLoader', () => { }); // mock response after the xhr request, otherwise it will be undefined - http.expectOne('/assets/i18n/en.json').flush({"TEST": "This is a test"}); + http.expectOne('./assets/i18n/en.json').flush({"TEST": "This is a test"}); }); });