-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (26 loc) · 697 Bytes
/
app.js
File metadata and controls
27 lines (26 loc) · 697 Bytes
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
angular.module('NoteWrangler', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider
.when('/', {
redirectTo: '/welcome'
})
.when('/notes', {
templateUrl: 'templates/pages/notes/index.html',
controller: function($http){
var controller = this;
$http({method: 'GET', url: '/notes'}).success(function(data){
controller.notes = data;
});
},
controllerAs: 'notesCtrl'
})
.when('/welcome', {
templateUrl: 'templates/welcome.html'
})
.when('/notes/new', {
templateUrl: 'templates/pages/notes/edit.html'
})
.otherwise({
redirectTo: '/welcome'
});
}]);