Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
app-1.js
var myApp = angular.module('myApp',['ngRoute']);
myApp.config(['$routeProvider','$locationProvider',
function($routeProvider, $locationProvider) {
$routeProvider
.when('/home', {
templateUrl: 'templates/home.html',
controller: 'HomeController'
})
.when('/contacts', {
templateUrl: 'templates/contacts.html',
controller: 'ContactController'
})
.when('/todos', {
templateUrl: 'templates/todos.html',
controller: 'TodoController'
})
.otherwise({
redirectTo: 'home'
});
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.