forked from SF-WDI-LABS/angular-books-crud-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (29 loc) · 794 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
angular.module('libraryApp', ['ngRoute'])
.config(config);
////////////
// ROUTES //
////////////
config.$inject = ['$routeProvider', '$locationProvider'];
function config ( $routeProvider, $locationProvider ) {
$routeProvider
.when('/', {
templateUrl: 'templates/books/index.html',
controller: 'BooksIndexController',
controllerAs:'BooksIndexCtrl'
})
.when('/:id', {
templateUrl: 'templates/books/show.html',
controller: 'BooksShowController',
controllerAs:'BooksShowCtrl'
})
/* Include the additional route here! */
.otherwise({
redirectTo: '/'
});
// this just makes it so our URLs don't have /#/ in them.
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
});
}