-
Notifications
You must be signed in to change notification settings - Fork 93
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
Localize router unable to pass data params on an empty path #152
Comments
Same issue here, I temporarily removed the data. I just tested with data: { skipRouteLocalization: true }, it causes the same issue. |
I have the same problem and I have been able to fix it by making a quick fix in parseSegmentValue function in the localize-router.service.ts file. The culprit is the condition To avoid this, I add a condition to check if there is a Here is the whole method. Please check my fork for the fix : https://github.com/cariboufute/localize-router
|
Description
In order to switch the navbar color on the homepage I have the following situation in my app-routing.module
in external-routing.module:
Note the deep empty route.
The page loads the first time fine. However if i switch the language on the homepage i get:
core.js:14597 ERROR TypeError: Cannot read property 'path' of undefined
Inspecting the error shows that in the code a data attribute causes the path to be split by "/", which obviously cannot happen in my case as i have an empty path.
localize-router.service.js:117
I can fix this by re-routing my homepage to /home as such, but this is not ideal:
🌍 Your Environment
**Angular Version: 7.1.1
Localize Router Version:
The text was updated successfully, but these errors were encountered: