Commit f3a07193 authored by Roland1975's avatar Roland1975

refactor to reflect logic on line 62

parent b299ed35
......@@ -65,11 +65,7 @@ todomvc.controller('TodoCtrl', function TodoCtrl($scope, $location, todoStorage,
};
$scope.todoCompleted = function (todo) {
if (todo.completed) {
$scope.remainingCount--;
} else {
$scope.remainingCount++;
}
$scope.remainingCount += todo.completed ? -1 : 1;
todoStorage.put(todos);
};
......
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