{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/2946","repository_url":"https://api.github.com/repos/angular-ui/ui-router","labels_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2946/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2946/comments","events_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2946/events","html_url":"https://github.com/angular-ui/ui-router/issues/2946","id":173533183,"number":2946,"title":"Accessing resolved data in Transition state's parents","user":{"login":"charlie-s","id":563379,"avatar_url":"https://avatars.githubusercontent.com/u/563379?v=3","gravatar_id":"","url":"https://api.github.com/users/charlie-s","html_url":"https://github.com/charlie-s","followers_url":"https://api.github.com/users/charlie-s/followers","following_url":"https://api.github.com/users/charlie-s/following{/other_user}","gists_url":"https://api.github.com/users/charlie-s/gists{/gist_id}","starred_url":"https://api.github.com/users/charlie-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlie-s/subscriptions","organizations_url":"https://api.github.com/users/charlie-s/orgs","repos_url":"https://api.github.com/users/charlie-s/repos","events_url":"https://api.github.com/users/charlie-s/events{/privacy}","received_events_url":"https://api.github.com/users/charlie-s/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-26T20:07:58Z","updated_at":"2016-08-26T23:29:23Z","closed_at":"2016-08-26T23:29:23Z","body":"This is similar to https://github.com/angular-ui/ui-router/issues/2864, but I also need to access parent state's resolved values. I've checked the source code but don't see how the Transition methods could be used to get this data from a parent state.\r\n\r\nGiven this router definition:\r\n\r\n```\r\n$stateProvider\r\n    .state('company', {\r\n        url: '/company/:id',\r\n        resolve: {\r\n            'company': ['$stateParams', 'Company', function($stateParams, Company) {\r\n                return Company.findById($stateParams).$promise;\r\n            }],\r\n            $title: ['company', function(company) { \r\n                return company.name;\r\n            }]\r\n        }\r\n    })\r\n    .state('company.overview', {\r\n        url: '/overview',\r\n        resolve: {\r\n            $title: function() { return 'Overview'; }\r\n        }\r\n    });\r\n```\r\n\r\nand a directive where I attempt to basically gather breadcrumb information about the current hierarchy:\r\n\r\n```\r\n$transitions.onSuccess({from: '*.*', to: '*.*'}, function(Transition) {\r\n\r\n    $rootScope.$title = Transition.getResolveValue('$title');\r\n\r\n    $rootScope.$breadcrumbs = [];\r\n\r\n    var state = $state.$current;\r\n\r\n    while (state) {\r\n        if (state.resolve && state.resolve.$title) {\r\n            $rootScope.$breadcrumbs.unshift({\r\n                title: state.resolve.$title,\r\n                href: $state.href(state)\r\n            });\r\n        }\r\n        state = state.parent;\r\n    }\r\n});\r\n```\r\n\r\nHow can I get the resolved value of `$title` on the current state's parent?"},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/comments/242875795","html_url":"https://github.com/angular-ui/ui-router/issues/2946#issuecomment-242875795","issue_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2946","id":242875795,"user":{"login":"charlie-s","id":563379,"avatar_url":"https://avatars.githubusercontent.com/u/563379?v=3","gravatar_id":"","url":"https://api.github.com/users/charlie-s","html_url":"https://github.com/charlie-s","followers_url":"https://api.github.com/users/charlie-s/followers","following_url":"https://api.github.com/users/charlie-s/following{/other_user}","gists_url":"https://api.github.com/users/charlie-s/gists{/gist_id}","starred_url":"https://api.github.com/users/charlie-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charlie-s/subscriptions","organizations_url":"https://api.github.com/users/charlie-s/orgs","repos_url":"https://api.github.com/users/charlie-s/repos","events_url":"https://api.github.com/users/charlie-s/events{/privacy}","received_events_url":"https://api.github.com/users/charlie-s/received_events","type":"User","site_admin":false},"created_at":"2016-08-26T23:29:23Z","updated_at":"2016-08-26T23:29:23Z","body":"That's perfect, thank you for the quick response and thorough example."}}
{"actor":{"display_login":"charlie-s"}}