diff --git a/public/controllers/controller.js b/public/controllers/controller.js
index 0b67206..b7f3d72 100755
--- a/public/controllers/controller.js
+++ b/public/controllers/controller.js
@@ -9,13 +9,40 @@
$scope.todolist = response;
});
$scope.task = {
- taskname: "E.g Task",
+ taskname: "",
Done: false,
- details: ''
- }
+ details: ""
+ }
$scope.addTask = function() {
//console.log($scope.todo);
+
$http.post('/todolist', $scope.task).success(function(response){
+ $http.get('/todolist').success(function(response) {
+ $scope.todolist = response;
+ });
+ console.log(response);
+ $scope.task = {
+ taskname: "",
+ Done: false,
+ details: ""
+ }
+ });
+
+
+
+ };
+
+ $scope.updateTask = function(task) {
+ $http.put('/todolist/'+task._id,task).success(function(response) {
+
+ });
+ };
+
+ $scope.deleteTask = function(id) {
+ var x=confirm("Are you sure?")
+
+ if(x==true){
+ $http.delete('/todolist/' + id).success(function(response) {
console.log(response);
});
$http.get('/todolist').success(function(response) {
@@ -23,10 +50,7 @@
});
$scope.todo = "";
};
-
- $scope.markTaskDone = function() {
- console.log($scope.todo);
- };
+ }
}]);
diff --git a/public/index.html b/public/index.html
index a53bf1e..b4d8563 100755
--- a/public/index.html
+++ b/public/index.html
@@ -12,8 +12,11 @@
text-decoration: line-through;
color:#ccc;
}
- small {
- cursor: pointer;
+ button{
+ display:none;
+ }
+ .delete:hover button{
+display:inline;
}
@@ -24,24 +27,21 @@
Tasks
- Details
Actions