diff --git a/todo-src/index.html b/todo-src/index.html index 89203ad..4170be8 100644 --- a/todo-src/index.html +++ b/todo-src/index.html @@ -15,7 +15,7 @@

My little to do app!

- +
  • - {{do}} +
    + {{do}} + Edit +
    +
    + + Done +
    diff --git a/todo-src/script.js b/todo-src/script.js index fe21743..f2557e1 100644 --- a/todo-src/script.js +++ b/todo-src/script.js @@ -5,12 +5,14 @@ var myApp = angular.module('app', []); myApp.controller('MainCtrl', function ($scope){ $scope.todos = ["Learn Angular", "Learn node"]; $scope.newItem = ""; + $scope.count = 2; $scope.addItem = function(){ console.log("in add"); if ($scope.newItem !== ""){ $scope.todos.push($scope.newItem); $scope.newItem = ""; + $scope.count+=1; } } @@ -18,6 +20,7 @@ myApp.controller('MainCtrl', function ($scope){ console.log("in delete"); var index = $scope.todos.indexOf(item); $scope.todos.splice(index, 1); + $scope.count-=1; }