Commit 20100b51 authored by Pascal Hartig's avatar Pascal Hartig

firebase-angular: refactored todo filtering

parent 246ebeee
......@@ -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;
}
});
\ No newline at end of file
};
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment