Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- todoApp.controller('todoController', ['$scope', function($scope) {
- $scope.todoList = [];
- $scope.dateList = [];
- $scope.todoAdd = function() {
- $scope.todoList.push({todoText:$scope.todoInput, done:false});
- $scope.todoInput = "";
- $scope.dateList.push({todoDate:$scope.dateInput});
- $scope.dateInput = "";
- }
- $scope.todoRemove = function() {
- var oldtodoList = $scope.todoList;
- $scope.todoList = [];
- angular.forEach(oldtodoList, function(elements) {
- if (!elements.done) $scope.todoList.push(elements);
- });
- };
- }]);
Add Comment
Please, Sign In to add comment