Created
September 23, 2015 10:35
-
-
Save ryananthonydrake/b3cdaa79785b56919341 to your computer and use it in GitHub Desktop.
An example of Angular routes using ngRoute and $routeProvider
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
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