-
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
Component reuse after language change #146
Comments
Take a look at last messages on #140 |
@gilsdav Thanks for your feedback. I just tried it with your gilsdav/ngx-translate-router and it seems to work. Perfect! |
Actually it strips query parameters from the url. And the behavior with the browser's back button is strange - it always returns me to the first page where I started from. |
Due to implementation changes in the router, routes are no longer mutable and therefore after language change we have to reset the routes. This has a side effect that routes are by default not reused. @gilsdav solved it nicely in his
|
I guess I will wait a few days because copying reuse strategy solved some of the problems but I still have a problem with browser's back button after changing the language. It crashes with the message: 'Cannot match any routes.' Regards |
@acopapic I'm not sure to understand your problem with browser back.
Keep in mind that component will not be recreated using ReuseStrategy but your guards will be called on every url changes |
@meeroslav Any update of Version 2 milestone? |
@gilsdav Sorry for the very late reply. My problem is the following: 'en-ch/search/ --navigate--> 'en/search?par1=val1&par2=val2' --changeLang--> 'de-ch/suchen?par1=val1&par2=val2' --browserBack--> Error: Uncaught (in promise): Error: Cannot match any routes. Url Segment: 'de-ch/suchen' |
Hi there,
I tried the latest version of the localize-router (2.0.0-RC.1) with Angular 6 and Angular 7 but it seems that now localize-router changeLanguage() recreates component every time, i.e. it treat the language change as a completely new route. What do I do wrong here?
With previous version (Angular 5.1.3 and localize-router 1.0.0-rc.4) it worked as I expected, with component reuse.
Thanks and regards,
Aleksandar
The text was updated successfully, but these errors were encountered: