forked from angular-app/angular-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprojects.js
More file actions
30 lines (25 loc) · 893 Bytes
/
Copy pathprojects.js
File metadata and controls
30 lines (25 loc) · 893 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
28
29
30
angular.module('projects', ['resources.projects', 'productbacklog', 'sprints'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/projects', {
templateUrl:'projects/projects-list.tpl.html',
controller:'ProjectsViewCtrl',
resolve:{
projects:['Projects', function (Projects) {
//TODO: fetch only for the current user
return Projects.all();
}]
}
});
}])
.controller('ProjectsViewCtrl', ['$scope', '$location', 'projects', function ($scope, $location, projects) {
$scope.projects = projects;
$scope.viewProject = function (projectId) {
$location.path('/projects/'+projectId);
};
$scope.manageBacklog = function (projectId) {
$location.path('/projects/'+projectId+'/productbacklog');
};
$scope.manageSprints = function (projectId) {
$location.path('/projects/'+projectId+'/sprints');
};
}]);