I would want to pass parent states already resolved data to child state onEnter function instead of again making an http call. I wanted to do this dynamically instead of passing the parent's resolve because I am generating multiple child states programatically as I will need to use the same child states for multiple parents and I have an angular service which does that.
I recently upgraded angular-uirouter from 0.2 to 1.0.8. Previously I used angular-ui-router extras and was able to achieve this using $state.$current.locals.globals., I injected $state to onEnter
$stateProvider
.state('parent',
resolve:
parentResolve: (Restangular) -> Restangular.all('route')
)
.state('child',
parent: 'parent'
url: '/child'
resolve:
childResolve: (Restangular) -> Restangular.one('bar')
onEnter: ($modal) ->
$modal.open(
templateUrl: 'templates/modal.html',
controller: 'ModalCtrl'
resolve:
parentResolve: -> parentResolve
childResolve: -> childResolve
)
)