How to navigate to the same page with Durandal?
By default, when I'm navigating to the same route, Durandal does not "refresh" the page.
When I will go to some other page and then go back, data is refreshed.
My problem is, that I'm changing language (by setting proper cookie) and after that I want to refresh the page to display content in newly selected language.
What worked but I'm not satisfied with it:
- I've created new "language" module which was setting new cookie on server side and after that i was using router.navigateBack();
The disadvantage was, that for a short period of time view for this language module was visible.
- I've been using location.reload() method, but this caused splash screen to appear.
It would be ideal to just refresh the same page with Durandal's router. I mean something like this: I'm on some page, I change the language by clicking on some link. After that entrance transition is applied (for the same page) and data is presented in new language.
I've been searching for this for whole day, but haven't found any solution to this.
I even tried something like this: router.navigate(router.activeInstruction().config.hash); but it didn't work. (data was not refreshed)