You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2020. It is now read-only.
I've come across an issue when using sticky states (with deep state redirect) and passing objects as state parameters via the 'params' property of a 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. Using only primitive params on the URL works fine, but there are cases when we need to pass complex objects to a state.
You will see the issue when you follow these steps:
(Initial state is tabs.account.stuff)
Enter text into the input box underneath "Here's my stuff"
Click on the 'Survey' tab
Click back to the 'Account' tab, which goes back to stuff because of DSR
(the input becomes empty because the view and controller get reloaded even though it's part of a sticky/dsr group of states)
My plunker changed the following three lines of code...
script.js - line 7
script.js - lines 31 & 32
Thanks!
The text was updated successfully, but these errors were encountered:
Actually, this may not be a good example because the savedSurvey state param will be a different object when coming to the state a second time (thus a reload should probably happen). I used this example for the sake of simplicity, but my actual example gets back to the sticky state via deep state redirect. I can try to modify the example.
Greetings,
I've come across an issue when using sticky states (with deep state redirect) and passing objects as state parameters via the 'params' property of a 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. Using only primitive params on the URL works fine, but there are cases when we need to pass complex objects to a state.
I took the Simple Sticky States Example (http://plnkr.co/edit/bFMLqLENmPFfCD0XCz8V?p=info) and made three small changes to it to demonstrate the issue. See my fork here...
http://plnkr.co/edit/0Zgn7IxvNDsT5kgcRjDO?p=info
You will see the issue when you follow these steps:
(Initial state is tabs.account.stuff)
(the input becomes empty because the view and controller get reloaded even though it's part of a sticky/dsr group of states)
My plunker changed the following three lines of code...
Thanks!
The text was updated successfully, but these errors were encountered: