diff --git a/README.md b/README.md index a53fe0f..17d44b3 100644 --- a/README.md +++ b/README.md @@ -126,3 +126,10 @@ You will be demonstrating your knowledge of GitHub workflow and Scrum fundamenta - Your repo's master branch should have the updated code (in the todo-src directory) to reflect each task/ticket. Have fun! :sunglasses: :+1: + +Joseph Cacioppo +Zach was here! +Ming +Cristo BOIIII +Lily +Himal diff --git a/corgi.gif b/corgi.gif new file mode 100644 index 0000000..e61eb35 Binary files /dev/null and b/corgi.gif differ diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..09b7fe3 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -7,7 +7,7 @@ - +

My little to do app!

@@ -25,18 +25,38 @@

My little to do app!

stuff i gotta do asap

- +

Incomplete Items: {{todos.length}}

+ +
+

+
+
+ diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..529b7be 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -3,7 +3,13 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ - $scope.todos = ["Learn Angular", "Learn node"]; + $scope.todos = [ + {name: "Learn Angular", done: false, editting: false, priority: 3}, + {name: "Learn node", done: false, editting: false, priority: 2}, + //added this "test" to test + {name: "Test", done: false, editting: false, priority: 1} + ]; + $scope.newItem = ""; $scope.addItem = function(){ @@ -11,16 +17,44 @@ myApp.controller('MainCtrl', function ($scope){ if ($scope.newItem !== ""){ $scope.todos.push($scope.newItem); $scope.newItem = ""; + /* tried this to set priority level automatically to 3: + * $scope.newItem.priority = 3; + * but i failed :( + */ } } - + $scope.deleteItem = function(item){ console.log("in delete"); var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); } - + + $scope.done = function(item){ + console.log("completed"); + if(!item.editting) item.done = !item.done; + } + + //if item is not scrached out, you can edit it + $scope.editItem = function(item) { + if(!item.done) item.editting = !item.editting; + } +// changePriority function. simply adds 1 to the priority +// unless it is at max priority level, then it goes back to 1 + $scope.changePriority = function(item) { + if(item.priority < 3) item.priority = item.priority + 1; + else item.priority = 1; + } + + $scope.removeCompletedItem = function(){ + for (var i = $scope.todos.length - 1; i >= 0; i--) { + if ($scope.todos[i].done) { + $scope.todos.splice(i,1); + } + } + } + }); /************************* @@ -33,4 +67,4 @@ myApp.controller('MainCtrl', function ($scope){ * - add a due date * - add reminder (setInterval) * - * *********************/ \ No newline at end of file + * *********************/ diff --git a/todo-src/style.css b/todo-src/style.css index cbbae65..c4cc090 100644 --- a/todo-src/style.css +++ b/todo-src/style.css @@ -1,6 +1,6 @@ /* Styles go here */ body { - background: grey; + background: #558C89; }