{"action":"opened","issue":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/3022","repository_url":"https://api.github.com/repos/angular-ui/ui-router","labels_url":"https://api.github.com/repos/angular-ui/ui-router/issues/3022/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-router/issues/3022/comments","events_url":"https://api.github.com/repos/angular-ui/ui-router/issues/3022/events","html_url":"https://github.com/angular-ui/ui-router/issues/3022","id":177957982,"number":3022,"title":"Detect state name that served component inside of component","user":{"login":"langdonx","id":441982,"avatar_url":"https://avatars.githubusercontent.com/u/441982?v=3","gravatar_id":"","url":"https://api.github.com/users/langdonx","html_url":"https://github.com/langdonx","followers_url":"https://api.github.com/users/langdonx/followers","following_url":"https://api.github.com/users/langdonx/following{/other_user}","gists_url":"https://api.github.com/users/langdonx/gists{/gist_id}","starred_url":"https://api.github.com/users/langdonx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/langdonx/subscriptions","organizations_url":"https://api.github.com/users/langdonx/orgs","repos_url":"https://api.github.com/users/langdonx/repos","events_url":"https://api.github.com/users/langdonx/events{/privacy}","received_events_url":"https://api.github.com/users/langdonx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-20T03:57:40Z","updated_at":"2016-09-20T03:57:40Z","closed_at":null,"body":"I'm using nested views and `angular.component`.  Basically:\r\n\r\n    <ui-view> // state.name: app.things\r\n        list of things\r\n\r\n        <ui-view>detail of selected thing</ui-view> // state.name: app.things.detail\r\n    </ui-view>\r\n\r\nIf I inject `$state` into both my List and Detail components, I can determine that `$state.$current` is `'app.things.detail'`, but I want to determine which state loaded the particular component.  In this case it would be:\r\n\r\n - List component: `'app.things'`\r\n - Detail component `'app.things.detail'`\r\n\r\nIs it possible to derive this information from `$state` or is there something else I can inject?  My states, if it's easier to visualize that way:\r\n\r\n\t// /jobs\r\n\t$stateProvider\r\n\t\t.state({\r\n\t\t\tname: 'ctk.job',\r\n\t\t\turl: '/jobs',\r\n\t\t\tcomponent: 'jobList'\r\n\t\t});\r\n\r\n\t// /jobs/#\r\n\t$stateProvider\r\n\t\t.state({\r\n\t\t\tname: 'ctk.job.detail',\r\n\t\t\turl: '/:jobId',\r\n\t\t\tcomponent: 'detail'\r\n\t\t});"}}
{"actor":{"display_login":"langdonx"}}