{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Front-end routes","type":"basic","slug":"front-end-routes","excerpt":"","body":"We still need to wire up our front end route.\n\nLet's open the `angular/RoutesConfig.js` file and add a new entry to the state provider. States are managed by [ui-router](https://github.com/angular-ui/ui-router/): a powerful routing library for Angular.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"$stateProvider.state('app.create_post', {\\n\\t\\t\\t\\turl: '/create-post',\\n\\t\\t\\t\\tviews: {\\n\\t\\t\\t\\t\\t'main:::at:::': {\\n\\t\\t\\t\\t\\t\\ttemplateUrl: getView('create_post')\\n\\t\\t\\t\\t\\t}\\n\\t\\t\\t\\t}\\n\\t\\t\\t})\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nNow you can go to this page by URL, or using `$state.go('app.create_post')` or manually in your browser by typing `/#/create-post`.\n\n> Prefer a screencast?\n[block:html]\n{\n  \"html\": \"<iframe width=\\\"560\\\" height=\\\"315\\\" src=\\\"https://www.youtube.com/embed/_ZWV9KBK2N8\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\"\n}\n[/block]","updates":[],"order":6,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57ffd85f755a2e1700c2bb1b","parentDoc":null,"version":{"version":"3.4","version_clean":"3.4.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["57ffd85f755a2e1700c2bb06","57ffd85f755a2e1700c2bb07","57ffd85f755a2e1700c2bb08","57ffd85f755a2e1700c2bb09","57ffd85f755a2e1700c2bb0a","57ffd85f755a2e1700c2bb0b","57ffd85f755a2e1700c2bb0c","57ffd85f755a2e1700c2bb0d"],"_id":"57ffd85f755a2e1700c2bb05","project":"567083021dabd80d00b122ae","releaseDate":"2016-10-13T18:54:23.018Z","__v":1,"createdAt":"2016-10-13T18:54:23.018Z"},"githubsync":"","project":"567083021dabd80d00b122ae","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Tutorial","slug":"tutorial","order":1,"from_sync":false,"reference":false,"_id":"57ffd85f755a2e1700c2bb07","createdAt":"2015-12-18T23:07:56.909Z","project":"567083021dabd80d00b122ae","__v":0,"version":"57ffd85f755a2e1700c2bb05"},"createdAt":"2015-12-18T23:10:15.201Z","user":"567082433a32d20d00c45cab","__v":0}
We still need to wire up our front end route. Let's open the `angular/RoutesConfig.js` file and add a new entry to the state provider. States are managed by [ui-router](https://github.com/angular-ui/ui-router/): a powerful routing library for Angular. [block:code] { "codes": [ { "code": "$stateProvider.state('app.create_post', {\n\t\t\t\turl: '/create-post',\n\t\t\t\tviews: {\n\t\t\t\t\t'[email protected]': {\n\t\t\t\t\t\ttemplateUrl: getView('create_post')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})", "language": "javascript" } ] } [/block] Now you can go to this page by URL, or using `$state.go('app.create_post')` or manually in your browser by typing `/#/create-post`. > Prefer a screencast? [block:html] { "html": "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/_ZWV9KBK2N8\" frameborder=\"0\" allowfullscreen></iframe>" } [/block]