Created
February 21, 2014 16:52
-
-
Save neilff/9138104 to your computer and use it in GitHub Desktop.
ui-router-example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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