ngx-translate access other baseurl
pbkh-bunthai opened this issue · 2 comments
pbkh-bunthai commented
I use this url to load my Login Ui: http://localhost:5000/login.
But in console, it printed error: http://localhost:8081/api/assets/i18n/ja.json 401 (Unauthorized).
It access to my api url.
It should be access this url http://localhost:5000/assets/i18n/ja.json instead.
I do a simple configuration.
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
I found this configuration in my project:
{
"bffBaseUrl": "http://localhost:8081"
}
How can I make it access to http://localhost:5000/assets/i18n/ja.json ?
aicokleinovink commented
I run into the same problem, what was your solution here??
pbkh-bunthai commented
I used this way, it's working fine:
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, window.location.origin + '/assets/i18n/json/', '.json');
}
I hope it work for you! :)