Description
Hi,
I'm evaluating ui-router as a routing infra for our project. One of the issues I'm having at the moment is implementing refreshing the view. We have a refresh button which should reload the content of the view (because, for example, something might have changed in the server and we might get different data in UI). However trying to transition to the same state as we're in right now with the same parameters is blocked (I debugged and saw it in the code). So I would like to have some possibility/API to overcome this blocking.
The other possibilities, as I see, are worse:
-
Reloading the state by explicitly transitioning through an interim state, the only purpose of which is to trick ui-router into thinking something changed. This works but it reloads the state with all its ancestor states and thus builds the whole UI from the scratch, instead of reloading only the leaf current state.
-
Extracting the content of the state controller in a function and calling it from the refresh button handler explicitly. It works but looks bad from the architectural perspective, as it requires an extra step from the developer. One of the reasons I am evaluating the ui-router is because it allows to split the logic into state hierarchies directly, without introducing unnecessary functions, so I don't want to lose this advantage.
Thanks.