-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
Copy pathdashboard.js
31 lines (27 loc) · 960 Bytes
/
dashboard.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
angular.module('dashboard', ['resources.projects', 'resources.tasks'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/dashboard', {
templateUrl:'dashboard/dashboard.tpl.html',
controller:'DashboardCtrl',
resolve:{
projects:['Projects', function (Projects) {
//TODO: need to know the current user here
return Projects.all();
}],
tasks:['Tasks', function (Tasks) {
//TODO: need to know the current user here
return Tasks.all();
}]
}
});
}])
.controller('DashboardCtrl', ['$scope', '$location', 'projects', 'tasks', function ($scope, $location, projects, tasks) {
$scope.projects = projects;
$scope.tasks = tasks;
$scope.manageBacklog = function (projectId) {
$location.path('/projects/' + projectId + '/productbacklog');
};
$scope.manageSprints = function (projectId) {
$location.path('/projects/' + projectId + '/sprints');
};
}]);