Skip to content

Commit

Permalink
Merge pull request tastejs#20 from jacobmumm/master
Browse files Browse the repository at this point in the history
quick fix to angular-persistence demo
  • Loading branch information
addyosmani committed Oct 19, 2011
2 parents fed955b + aa8db40 commit acaab07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions todo-example/angularjs/persistencejs/js/controllers.js
Expand Up @@ -59,6 +59,7 @@ App.Controllers.TodoController = function (persistencejs) {
angular.forEach(oldTodos, function(todo) {
if (!todo.done) self.todos.push(todo);
});
persistencejs.clearCompletedItems();
};

self.hasFinishedTodos = function() {
Expand Down
4 changes: 4 additions & 0 deletions todo-example/angularjs/persistencejs/js/services.js
Expand Up @@ -28,6 +28,10 @@ angular.service('persistencejs', function() {
});
},

clearCompletedItems: function(){
Todo.all().filter('done','=',true).destroyAll();
},

remove: function(item){
Todo.all().filter('content','=',item.content).destroyAll();
},
Expand Down

0 comments on commit acaab07

Please sign in to comment.