Open that1guy opened 5 years ago
@christopherthielen any chance you could help with this one real quick? Just point me in the right direction.
I discovered that this is happens when trying to navigate to the saved UI sticky state without the exact same params that are specified in .state(). In other words, if it detects that the stateParams have changed, it will reload. If upon initialization you create the state with certain parameters, the next time you navigate to it you should specify the exact same parameters.
Also in issue #273, there is an interest approach to prevent having to pass the same parameters each time, and that is to create an intermediate state.
The initial transition to the sticky state works well, but when you transition away and then come back to the sticky state, the view reloads and the controller re-runs (thus losing any changes made on that scope/view). This issue only happens when $stateParams contains a javascript object.
See my plunk here: http://plnkr.co/edit/b9zpVyApL6tx2pe8XoZz?p=preview
(Initial state is
app.survey
)1) Click on the
Property Details Page
tab 2) Click theGo back to app.survey
on the property details page 3) Notice that the controller is reloadedThis issue is realted to https://github.com/christopherthielen/ui-router-extras/issues/239. but you fixed that scenario. I'm not sure what I'm doing differently to be reproducing this issue. I'm using the latest
ui-router legacy
andui-router-extras
Thanks for help.