Skip to content

Instantly share code, notes, and snippets.

@akleemans
Created November 9, 2016 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akleemans/bc6fd06207ef0149c852694b7df632ca to your computer and use it in GitHub Desktop.
Save akleemans/bc6fd06207ef0149c852694b7df632ca to your computer and use it in GitHub Desktop.
Routing configuration for vocabulario app
angular.module('VociTrainer', ['ngRoute'])
.config(['$routeProvider', '$locationProvider',
function ($routeProvider, $locationProvider) {
$routeProvider
.when('/home', {
templateUrl: 'views/home/home.html',
controller: 'HomeCtrl',
controllerAs: 'home'
})
.when('/impressum', {
templateUrl: 'views/impressum/impressum.html',
controller: 'ImpressumCtrl',
controllerAs: 'impressum'
})
.when('/practice', {
templateUrl: 'views/practice/practice.html',
controller: 'PracticeCtrl',
ontrollerAs: 'practice'
})
.when('/profile', {
templateUrl: 'views/profile/profile.html',
controller: 'ProfileCtrl',
controllerAs: 'profile'
})
// ...
.otherwise({redirectTo: '/home'});
// setting html5 mode
$locationProvider.html5Mode(true);
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment