Closed sercangurbuz closed 8 years ago
The DOM, $scope, and controller of a Sticky State (and all activated substates) are retained until one of two things happen:
- The parent of the sticky state is exited
- The parent of the sticky state is directly activated
When a parameter value changes, ui-router exits and re-enters a state. This means the parent main.product
is exited and entered, thus causing the sticky state to reload too.
Any workaround to keep sticky states works without reloading parent state ?
I don't think it's possible without rearranging your state definitions.
For instance, you could move your main.product
logic into a child state main.product.view
that has the parameter :id
.
Similiar question have been asked but didnt find a solution for the following case. States i have
Let say,there is a crud form in product state. Initially sticky tabs works nice,however Id param changes to some identity number without reload after save.
$state.go('main.product',{id:[identity]},{notify:false,reload:false});
Then changing the sticky states cause the whole reload initializing respectively main.product main.product.info - say this is the previous state main.product.comments - say this is the current state
Any workaround to keep sticky states works without reloading parent state ?
plunker :https://plnkr.co/edit/null7bfYhARa5v0Lu9mD?p=info