This repository has been archived by the owner on Nov 8, 2021. It is now read-only.
Loader does not work with base-href set #11
Comments
+1 |
4 similar comments
+1 |
+1 |
👍 |
👍 |
Is it gonna be merged soon ? it's been 2 month that there's a fix already. |
How do I workaround this? |
@pgossmann Provide your own TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
}), export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/');
} |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When having a base-href set, the loader ignores it and can't fetch the i18n files.
Example:
"build": "ng build --aot --prod --base-href /somestring/",
All requests are ignoring the base-href: "/assets/i18n/en.json" instead of "/somestring/assets/i18n/en.json".
Adding a dot to the prefix ("./assets/i18n/") fixes the problem.
The text was updated successfully, but these errors were encountered: