Guest User

Untitled

a guest
Dec 19th, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. todoApp.controller('todoController', ['$scope', function($scope) {
  2.  
  3. $scope.todoList = [];
  4. $scope.dateList = [];
  5.  
  6. $scope.todoAdd = function() {
  7. $scope.todoList.push({todoText:$scope.todoInput, done:false});
  8. $scope.todoInput = "";
  9.  
  10. $scope.dateList.push({todoDate:$scope.dateInput});
  11. $scope.dateInput = "";
  12.  
  13. }
  14.  
  15. $scope.todoRemove = function() {
  16. var oldtodoList = $scope.todoList;
  17. $scope.todoList = [];
  18. angular.forEach(oldtodoList, function(elements) {
  19. if (!elements.done) $scope.todoList.push(elements);
  20. });
  21. };
  22.  
  23. }]);
Add Comment
Please, Sign In to add comment