super-productivity/app/scripts/dialogs/create-project/create-project-c.js
2017-01-10 12:29:42 +01:00

36 lines
760 B
JavaScript

/**
* @ngdoc function
* @name superProductivity.controller:CreateProjectCtrl
* @description
* # CreateProjectCtrl
* Controller of the superProductivity
*/
(function () {
'use strict';
angular
.module('superProductivity')
.controller('CreateProjectCtrl', CreateProjectCtrl);
/* @ngInject */
function CreateProjectCtrl($mdDialog, Projects, $mdToast) {
let vm = this;
vm.task = {};
vm.createProject = (project) => {
Projects.createNew(project.title, {});
let toast = $mdToast.simple()
.textContent('You created the project "' + project.title + '"')
.position('bottom');
$mdToast.show(toast);
$mdDialog.hide();
};
vm.cancel = () => {
$mdDialog.hide();
};
}
})();