Skip to content

Instantly share code, notes, and snippets.

@fnakstad
Last active December 19, 2015 23:09
Show Gist options
  • Save fnakstad/6032777 to your computer and use it in GitHub Desktop.
Save fnakstad/6032777 to your computer and use it in GitHub Desktop.
angular.module('myApp', ['myApp.services', 'ngCookies'])
.config(['$routeProvider', '$locationProvider',
function ($routeProvider, $locationProvider) {
// ...
var access = routingConfig.accessLevels;
$routeProvider.when('/register',
{
templateUrl: 'partials/register',
controller: RegisterCtrl,
access: access.anon
});
$routeProvider.when('/private',
{
templateUrl: 'partials/private',
controller: PrivateCtrl,
access: access.user
});
$routeProvider.when('/admin',
{
templateUrl: 'partials/admin',
controller: AdminCtrl,
access: access.admin
});
// ...
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment