Skip to content

Instantly share code, notes, and snippets.

@bmdayal
Created October 18, 2015 03:10
Basic Angular JS route example
(function () {
var app = angular.module("addressBookApp", ['ngRoute', 'angular-loading-bar']);
app.config(function ($routeProvider) {
$routeProvider
.when("/person", {
templateUrl: 'app/views/person.html',
controller: "PersonCtrl"
})
.when("/person/:personId", {
templateUrl: 'app/views/persondetail.html',
controller: "PersonAddressCtrl"
})
.otherwise({ redirectTo: "/person" })
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment