From 20100b515b5152e7f98dedb079d27d260f3fe0d1 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Sun, 4 Aug 2013 17:14:24 +0200 Subject: [PATCH] firebase-angular: refactored todo filtering --- .../architecture-examples/firebase-angular/js/app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/labs/architecture-examples/firebase-angular/js/app.js b/labs/architecture-examples/firebase-angular/js/app.js index c6e6d29d45..a7ef03de0f 100644 --- a/labs/architecture-examples/firebase-angular/js/app.js +++ b/labs/architecture-examples/firebase-angular/js/app.js @@ -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 + }; +});