{"action":"created","issue":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/2520","repository_url":"https://api.github.com/repos/angular-ui/ui-router","labels_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2520/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2520/comments","events_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2520/events","html_url":"https://github.com/angular-ui/ui-router/issues/2520","id":131263451,"number":2520,"title":"Parent state not resolving when transitioning from child","user":{"login":"jpodpro","id":15255854,"avatar_url":"https://avatars.githubusercontent.com/u/15255854?v=3","gravatar_id":"","url":"https://api.github.com/users/jpodpro","html_url":"https://github.com/jpodpro","followers_url":"https://api.github.com/users/jpodpro/followers","following_url":"https://api.github.com/users/jpodpro/following{/other_user}","gists_url":"https://api.github.com/users/jpodpro/gists{/gist_id}","starred_url":"https://api.github.com/users/jpodpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpodpro/subscriptions","organizations_url":"https://api.github.com/users/jpodpro/orgs","repos_url":"https://api.github.com/users/jpodpro/repos","events_url":"https://api.github.com/users/jpodpro/events{/privacy}","received_events_url":"https://api.github.com/users/jpodpro/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular-ui/ui-router/labels/PlunkrPlease","name":"PlunkrPlease","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-04T07:03:29Z","updated_at":"2016-02-04T23:53:34Z","closed_at":null,"body":"i have a resolve in my parent state and a resolve in each child state. the resolves all fire properly until i transition from a child state to the parent state. in this situation the resolve is not run and the data i expect from the resolve is null. \r\n\r\ni couldn't figure out if this is expected behavior as nothing in the documentation seems to imply this behavior. if this is expected behavior, am i required to abandon the resolve system in order to get the data i need? hooks are an option but it seems strange to have to create a hook for this one special case."},"comment":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/comments/180109240","html_url":"https://github.com/angular-ui/ui-router/issues/2520#issuecomment-180109240","issue_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2520","id":180109240,"user":{"login":"jpodpro","id":15255854,"avatar_url":"https://avatars.githubusercontent.com/u/15255854?v=3","gravatar_id":"","url":"https://api.github.com/users/jpodpro","html_url":"https://github.com/jpodpro","followers_url":"https://api.github.com/users/jpodpro/followers","following_url":"https://api.github.com/users/jpodpro/following{/other_user}","gists_url":"https://api.github.com/users/jpodpro/gists{/gist_id}","starred_url":"https://api.github.com/users/jpodpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpodpro/subscriptions","organizations_url":"https://api.github.com/users/jpodpro/orgs","repos_url":"https://api.github.com/users/jpodpro/repos","events_url":"https://api.github.com/users/jpodpro/events{/privacy}","received_events_url":"https://api.github.com/users/jpodpro/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T23:53:34Z","updated_at":"2016-02-04T23:53:34Z","body":"thanks for the detailed info.\r\n\r\nhowever my case is using ng-href to transition between states. basically i have a profile menu with sub-menu items. the top-level menu items are sub-states of the profile (profilePage.activity, profilePage.tracks, etc). the sub-menu states are sub-states of one of the top level states ( profilePage.activity.upvotes, profilePage.activity.plays, etc). i prefer to use ng-href so that the status bar shows the actual href destination of selecting one of the menu items. \r\n\r\nthe problem is that any of the top level or sub menu items share their controller and all load data into the same view, since any one of the top or sub items is simply selecting the content to be shown below the menu. i can imagine that in a typical scenario, the parent data wouldn't be changing when navigating from a sub state to its parent. but in my case a child state overrides the parent data because only one state is shown at a time, top or sub.\r\n\r\ni was thinking of changing this from parent states to sibling states because obviously that would fix everything. but doing this means that i don't get the url hierarchy i wanted: ( <username>/activity/plays ). i was sure that with 1.0 there would be a way to achieve what i want but it doesn't seem obvious.\r\n\r\nbelow is a subset of my state definition code. if i'm in the profilePage.activity.plays state and i navigate in the menu to the profilePage.activity state, the resolve is not loaded and contentData is null. it seems like my options are as follows:\r\n\r\n- change to sibling states, sacrifice desired url hierarchy\r\n- use ng-click and $state.go to force reload as described above\r\n- use separate resolves, capture and save the parent data when a it is loaded, capture state change using hook and use saved data to load. ugh.\r\n\r\nit this isn't enough info i can try to make a plunkr...\r\n\r\n\r\n```JS\r\n// top level profile state works fine\r\n$stateProvider.state( 'profilePage', {\r\n    url: '/u/:user',\r\n    templateUrl: 'app/user/profilePage/profilePage.html',\r\n    controller: 'ProfileController',\r\n    controllerAs: 'pc',\r\n    resolve: {\r\n        profileData: ['profileService', '$stateParams', function( profileService, $stateParams )\r\n        {\r\n            profileService.init( $stateParams.user );\r\n            return profileService.getProfile();\r\n        }]\r\n    }\r\n});\r\n\r\n$stateProvider.state( 'profilePage.activity', {\r\n    url: '/u/:user',\r\n    templateUrl: 'app/user/profilePage/profilePage.tracks.html',\r\n    controller: 'ProfileContentController',\r\n    controllerAs: 'pcc',\r\n    resolve: {\r\n        contentData: ['profileService', '$transition$', function( profileService, $transition$ )\r\n        {\r\n            return profileService.loadState( $transition$.to().name, 0 );\r\n        }]\r\n    }\r\n});\r\n\r\n$stateProvider.state( 'profilePage.activity.plays', {\r\n    url: '/u/:user',\r\n    templateUrl: 'app/user/profilePage/profilePage.activity.plays.html',\r\n    controller: 'ProfileContentController',\r\n    controllerAs: 'pcc',\r\n    resolve: {\r\n        contentData: ['profileService', '$transition$', function( profileService, $transition$ )\r\n        {\r\n            return profileService.loadState( $transition$.to().name, 0 );\r\n        }]\r\n    }\r\n});\r\n```"}}