Skip to content

Instantly share code, notes, and snippets.

@neilff
Created February 21, 2014 16:52
Show Gist options
  • Save neilff/9138104 to your computer and use it in GitHub Desktop.
Save neilff/9138104 to your computer and use it in GitHub Desktop.
ui-router-example
$stateProvider
.state('age-gate', {
url: '/',
templateUrl: 'views/age-gate.html',
controller: 'AgeGateCtrl'
})
.state('home', {
url: '/home',
templateUrl: 'views/home.html',
controller: 'HomeCtrl'
})
.state('home.collection', {
url: '/:collection',
views: {
'collection@home': {
templateUrl: 'views/home.collection.html',
controller: 'CollectionCtrl',
}
}
})
.state('home.collection.item', {
url: '/:item',
views: {
'item@home' : {
templateUrl: 'views/home.item.html',
controller: 'ItemCtrl'
}
}
})
.state('faq', {
url: '/faq',
templateUrl: 'views/faq.html',
controller: 'FaqCtrl'
})
.state('faq.item', {
url: '/:item',
templateUrl: 'views/faq.content.html',
controller: 'FaqItemCtrl'
})
.state('privacy', {
url: '/privacy',
templateUrl: 'views/static-content.html',
controller: 'StaticCtrl'
})
.state('terms-and-conditions', {
url: '/terms-and-conditions',
templateUrl: 'views/static-content.html',
controller: 'StaticCtrl'
});
$urlRouterProvider.otherwise('/');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment