se-hub/templates/js/controllers/newTasksController.js

33 lines
669 B
JavaScript
Raw Normal View History

2015-06-21 19:27:48 +00:00
angular.module('SeHub').controller('newTasksController', ['$scope',
function($scope) {
$scope.componentTypes = [{
"type": "textbox"
}, {
"type": "textarea"
}, {
"type": "checkbox"
}];
$scope.task = {};
$scope.task.task = {};
$scope.task.components= [];
$scope.task.isPersonal = false;
2015-06-21 19:27:48 +00:00
// $scope.task = [];
2015-06-21 19:27:48 +00:00
$scope.addComponent = function() {
$scope.task.components.push($scope.newComp);
2015-06-21 19:27:48 +00:00
$scope.newComp = {};
}
$scope.dueTime = function(){
if(!$scope.task.date || $scope.task.date === '')
$scope.dueTimeFromNow = "";
var d = new Date($scope.task.date);
$scope.dueTimeFromNow = moment(d).fromNow();
}
2015-06-21 19:27:48 +00:00
}
]);