mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-29 18:50:07 +00:00
36 lines
654 B
JavaScript
36 lines
654 B
JavaScript
/**
|
|
* @ngdoc function
|
|
* @name superProductivity.controller:AddTaskCtrl
|
|
* @description
|
|
* # AddTaskCtrl
|
|
* Controller of the superProductivity
|
|
*/
|
|
|
|
(function () {
|
|
'use strict';
|
|
|
|
angular
|
|
.module('superProductivity')
|
|
.controller('AddTaskCtrl', AddTaskCtrl);
|
|
|
|
/* @ngInject */
|
|
function AddTaskCtrl($mdDialog, Tasks, theme) {
|
|
let vm = this;
|
|
vm.task = {};
|
|
vm.theme = theme;
|
|
|
|
vm.addTask = () => {
|
|
if (vm.isAddToBacklog) {
|
|
Tasks.addNewToTopOfBacklog(vm.task);
|
|
} else {
|
|
Tasks.addToday(vm.task);
|
|
}
|
|
|
|
$mdDialog.hide();
|
|
};
|
|
|
|
vm.cancel = () => {
|
|
$mdDialog.hide();
|
|
};
|
|
}
|
|
})();
|