self modalHelper ModalHelper directives templates forms task html stat

 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
self.modalHelper = ModalHelper('directives/templates/forms/task.html', {
statuses: function() {
return $scope.statuses.$promise;
},
importances: function() {
return $scope.importances.$promise;
}
}, {
createNewStatus: function() {
var taskModel = this.getModel();
return function(value) {
statusModalHelper.openModal({value: value}, TaskStatuses.save).result.then(function (taskStatus) {
TaskStatusesService.addObject(taskStatus);
$scope.statuses.push(taskStatus);
taskModel.status = taskStatus.id;
});
}
},
createNewImportance: function() {
var taskModel = this.getModel();
return function(value) {
importanceModalHelper.openModal({value: value}, TaskImportances.save).result.then(function (taskImportance) {
TaskImportancesService.addObject(taskImportance);
$scope.importances.push(taskImportance);
taskModel.importance = taskImportance.id;
});
}
}
});