Skip to content

Instantly share code, notes, and snippets.

@bmdayal
Created October 18, 2015 03:10
Show Gist options
  • Save bmdayal/3855ae69a7df5ab50baa to your computer and use it in GitHub Desktop.
Save bmdayal/3855ae69a7df5ab50baa to your computer and use it in GitHub Desktop.
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