Skip to content

Commit

Permalink
firebase-angular: refactored todo filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
passy committed Aug 4, 2013
1 parent 246ebee commit 20100b5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions labs/architecture-examples/firebase-angular/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ todomvc.filter('todoFilter', function ($location) {
angular.forEach(input, function (todo, id) {
var path = $location.path();
if (path === '/active') {
if (todo.completed === false) filtered[id] = todo;
if (!todo.completed) {
filtered[id] = todo;
}
} else if (path === '/completed') {
if (todo.completed === true) filtered[id] = todo;
if (todo.completed) {
filtered[id] = todo;
}
} else {
filtered[id] = todo;
}
});
return filtered;
}
});
};
});

0 comments on commit 20100b5

Please sign in to comment.