Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app-routing.module.ts "LocalizeRouterHttpLoader" not working #14

Open
yavuzgunay opened this issue Oct 8, 2021 · 0 comments
Open

app-routing.module.ts "LocalizeRouterHttpLoader" not working #14

yavuzgunay opened this issue Oct 8, 2021 · 0 comments

Comments

@yavuzgunay
Copy link

Hi,

I want to get the settings in app-routing.module.ts file from locales.json file. I can pull the locales.json file in development mode, but when I use angular universal ssr and define it as LocalizeRouterHttpLoader, it gives 500 error. After setting ManualParserLoader to app-routing.module.ts file, it does not give 500 error.

"@angular/core": "^12.1.1",
"@gilsdav/ngx-translate-router": "^3.1.6",
"@gilsdav/ngx-translate-router-http-loader": "^1.1.2",
"@nguniversal/express-engine": "^12.1.0",

Note : This method working on angular universal ssr.
export function createTranslateLoader(translate: TranslateService, location: Location, settings: LocalizeRouterSettings) {
return new ManualParserLoader(translate, location, settings, ['en','fr'], 'ROUTES.');
}
Note : This method not working on angular universal ssr.
export function HttpLoaderFactory(translate: TranslateService, location: Location, settings: LocalizeRouterSettings, http: HttpClient) {
return new LocalizeRouterHttpLoader(translate, location, settings, http);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant