Skip to content

Instantly share code, notes, and snippets.

@bendrucker
Created August 24, 2014 17:38
Show Gist options
  • Save bendrucker/c3dbd161472cfa5af29d to your computer and use it in GitHub Desktop.
Save bendrucker/c3dbd161472cfa5af29d to your computer and use it in GitHub Desktop.
Nested routes
.config( function ($stateProvider) {
$stateProvider
.state('post', {
url: '/posts',
template: '<ui-view />',
abstract: true
})
.state('post.create', {
url: '/create',
templateUrl: '/views/post/create.html',
controller: 'PostCreate'
})
.state('post.read', {
url: '/:id',
templateUrl: '/views/post/single.html',
controller: 'PostSingle'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment