|
2 | 2 | (function(){ |
3 | 3 |
|
4 | 4 | angular.module('dashboardProjectApp') |
5 | | - .controller('projectDetailController', ['$scope','$state', 'UserStory', |
6 | | - function($scope, $state, UserStory) { |
| 5 | + .controller('projectDetailController', ['$scope','$state', 'UserStory', '$location', |
| 6 | + function($scope, $state, UserStory, $location) { |
7 | 7 |
|
8 | 8 | $scope.taskId = $state.params.id; |
9 | 9 | $scope.openTasks = {}; |
|
39 | 39 | $scope.actualProject = {}; |
40 | 40 |
|
41 | 41 | function getFile() { |
| 42 | + |
42 | 43 | UserStory.findById({id:$scope.taskId}, |
43 | 44 | function success(userStory) { |
44 | 45 | $scope.userStory = userStory; |
|
48 | 49 | $scope.actualProject[key] = $scope.userStory.tasks_status[key].projects[0] |
49 | 50 | } |
50 | 51 |
|
| 52 | + }, function onError(error){ |
| 53 | + $location.path('/projectDetail/notFound/' + $scope.taskId); |
51 | 54 | }); |
52 | 55 | }; |
53 | 56 |
|
54 | 57 | $scope.selectProject = function(keyProject, idTask){ |
55 | 58 | $scope.actualProject[idTask] = keyProject |
56 | 59 | } |
57 | 60 |
|
58 | | - getFile(); |
59 | 61 |
|
60 | 62 | $scope.showMore = function(key){ |
61 | 63 | $scope.showText[key] = true; |
|
69 | 71 | window.location.href = "mailto:" + email + "?subject=Mail to " + email; |
70 | 72 | } |
71 | 73 |
|
| 74 | + getFile(); |
72 | 75 |
|
73 | 76 | }]) |
74 | 77 | .filter('capitalize', function() { |
75 | 78 | return function(input) { |
76 | 79 | return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : ''; |
77 | 80 | } |
78 | | - }).filter('removeDashes', function() { |
| 81 | + }) |
| 82 | + .filter('removeDashes', function() { |
79 | 83 | return function(string) { |
80 | 84 |
|
81 | 85 | if (!angular.isString(string)) { |
|
0 commit comments