{"action":"closed","issue":{"url":"https://api.github.com/repos/angular-ui/ui-router/issues/2923","repository_url":"https://api.github.com/repos/angular-ui/ui-router","labels_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2923/labels{/name}","comments_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2923/comments","events_url":"https://api.github.com/repos/angular-ui/ui-router/issues/2923/events","html_url":"https://github.com/angular-ui/ui-router/issues/2923","id":171480502,"number":2923,"title":"Configuring a default state with templates from outside of ui-router?","user":{"login":"raymondwang","id":4248263,"avatar_url":"https://avatars1.githubusercontent.com/u/4248263?v=4","gravatar_id":"","url":"https://api.github.com/users/raymondwang","html_url":"https://github.com/raymondwang","followers_url":"https://api.github.com/users/raymondwang/followers","following_url":"https://api.github.com/users/raymondwang/following{/other_user}","gists_url":"https://api.github.com/users/raymondwang/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondwang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondwang/subscriptions","organizations_url":"https://api.github.com/users/raymondwang/orgs","repos_url":"https://api.github.com/users/raymondwang/repos","events_url":"https://api.github.com/users/raymondwang/events{/privacy}","received_events_url":"https://api.github.com/users/raymondwang/received_events","type":"User","site_admin":false},"labels":[{"id":124767732,"url":"https://api.github.com/repos/angular-ui/ui-router/labels/PlunkrPlease","name":"PlunkrPlease","color":"5319e7","default":false},{"id":127926307,"url":"https://api.github.com/repos/angular-ui/ui-router/labels/not%20enough%20information","name":"not enough information","color":"5319e7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-16T18:06:08Z","updated_at":"2018-02-26T20:01:10Z","closed_at":"2018-02-26T20:01:10Z","author_association":"NONE","body":"I'm having a little trouble figuring out how to wire up an application on my website to use both ui-router along with a default template. Essentially, my initial template comes from Flask/Jinja, and I would like to load it by default upon landing on `/state`. This is pretty important to my product, for which server-side rendering for search engine optimization is necessary. Once some action is taken on the page, I want to hit a child state at `/state/#/child`. This all works more or less for free with the following setup:\n\n```\nDefault template:\n<ui-view>\n  <some-default-content />\n</ui-view>\n\nRouter:\n$stateProvider.state('childState', {\n  url: '/child',\n  template: 'childTemplate',\n  controller: 'childController'\n});\n\nOutput after $state.go('childState'):\n<ui-view>\n  <child-template />\n</ui-view>\n```\n\nThe problem is that when I refresh the page on the child state, or directly route to it, I continue to land on the default state. I'm pretty confident that my router is not configured properly for this use case, and that my router doesn't really know how to handle the path on its own when I directly link to the page. However, the documentation I've poked around in all seems to support the notion that some parent up the tree, at some point, needs a `<ui-view>` template. How can I achieve this if this template comes from outside of the router?\n\nEssentially, what I _think_ I want my router to look like is something like this:\n\n```\n$stateProvider.state('Parent', {\n  abstract: true,\n  url: '/'\n});\n\n$stateProvider.state('Parent.default', {\n  url: ''\n});\n\n$stateProvider.state('Parent.child', {\n  url: '/child',\n  template: 'childTemplate',\n  controller: 'childController'\n});\n```\n\nBut I'm pretty sure at least one of the first two states needs something that I'm missing.\n"}}
{"actor":{"display_login":"raymondwang"}}