Last active
August 29, 2015 14:27
-
-
Save mbranicky/a9447db9184e83ae5562 to your computer and use it in GitHub Desktop.
Routing (basic examples)
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
var app = angular.module('GalleryApp', ['ngRoute']); | |
app.config(function ($routeProvider) { | |
$routeProvider | |
.when('/', { | |
controller: 'HomeController', | |
templateUrl: 'views/home.html' | |
}) | |
.when('/photos/:id', { | |
controller: 'PhotoController', | |
templateUrl: 'views/photo.html' | |
}) | |
.otherwise({ | |
redirectTo: '/' | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment