-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts.js
35 lines (30 loc) · 914 Bytes
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function TodoCtrl($scope) {
//Get Todo DEMO List
$scope.todos = [
{text: 'Get this Coded up for Moxley Stratton', done:false},
{text: 'Find out if Peter Lee writes PHP too', done:false},
{text: 'Discover how many more Tattoos does Mattyi have', done:false},
{text: 'Find out how Seve pronounces his name', done:false},
{text: 'Get a good conversation going with Taurie', done:false}
];
//Get Todo Count
$scope.getTotalTodos = function () {
return $scope.todos.length;
};
//Add Todo
$scope.addTodo = function () {
$scope.todos.push({text:$scope.formTodoText, done:false});
$scope.formTodoText = '';
};
//Delete Todo
$scope.delTodo = function(item){
//var index = $scope.todos[item];
$scope.todos.splice(item,1);
};
//Clear Todo
$scope.clearCompleted = function () {
$scope.todos = _.filter($scope.todos, function(todo){
return !todo.done;
});
};
};