Guest User

Untitled

a guest
May 19th, 2015
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $scope.add = function(){    // Function used to add a value to list. Value has name, type, and priority.
  2.         if($scope.thing){  
  3.             $scope.items.push(
  4.                 {name: $scope.thing,
  5.                  type: $scope.worktypeSelection,
  6.                  priority: $scope.prioritySelection,
  7.                  completed: false
  8.                 });
  9.             $scope.items[$scope.items.length - 1] = persistentToDoList.save({command: 'addItem'}, $scope.items[$scope.items.length - 1]);
  10.             $scope.thing = '';
  11.         }
  12.         else{
  13.             alert("Empty task is not allowed!");
  14.         }
  15.     };
Advertisement
Add Comment
Please, Sign In to add comment