angularjs - ui-router does not run a parent state's resolve promise when using $state.go() -


i have abstract parent state resolve promise returns information current user. information injected controllers of child states.

however when use $state.go('parent.child') resolve promise function not being executed. if browse url representing state though, executes fine.

do need specify resolve object on each child state , omit parent?

a parent state resolve resolve once given set of $stateparams values. if parent state not rely on $stateparams or not use any, dependencies resolved once, regardless of child state changes.

the difference in behaviour seeing child state change not result in parent resources being reloaded, whereas location change full parent , child states reloaded.

you can observe behaviour in plunk.

the example has $stateparams value in parent state on children dependent. changing state via $state.go or ui-sref (both methods provided) result in refresh of parent resource. however, changing state child state without change $stateparams parameter not refresh parent resource , returned value provided.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -