Closed mattdarveniza closed 3 years ago
I believe this is a timing issue from when the store gets updated. Currently, the store is updated onFinish
, but resolve happens during the onEnter
phase, from what I can tell. When I switch the onFinish
hook to onEnter
, then I am able to access the correct currentParams in my resolve blocks.
Is there a reason why the store gets stored onFinish
rather than earlier, such as during onEnter
?
@kaidjohnson Not off the top of my head. I would be keen to see a PR to fix this if anyone has a spare moment. I'll try and have a little look.
I've got the fairly common pattern of calling some data loading actions in the resolve block of my routes, however these actions rely on the ui-router state parameters already being defined.
It seems that the router actions that set the state params are dispatched after the resolve block. Is there a way to access those parameters in the resolve outside of injecting
$stateParams
in directly?