Skip to content

Instantly share code, notes, and snippets.

@ryananthonydrake
Created September 23, 2015 10:35
Show Gist options
  • Save ryananthonydrake/b3cdaa79785b56919341 to your computer and use it in GitHub Desktop.
Save ryananthonydrake/b3cdaa79785b56919341 to your computer and use it in GitHub Desktop.
An example of Angular routes using ngRoute and $routeProvider
angular.module('NoteApp', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/notes', {
templateUrl: 'templates/pages/notes/index.html'
})
.when('/users', {
templateUrl: 'templates/pages/users/index.html'
})
.when('/notes/new', {
templateUrl: 'templates/pages/notes/edit.html'
})
.when('/', {
redirectTo: '/users'
})
.otherwise({
redirectTo: '/notes'
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment