Commit 24c22e24 authored by Sindre Sorhus's avatar Sindre Sorhus

Merge pull request #636 from glebm/patch-1

Remove ternary expressions
parents 26bdbb2d 2d92e706
......@@ -20,9 +20,7 @@ todomvc.controller('TodoCtrl', function TodoCtrl($scope, $location, todoStorage,
$scope.location = $location;
$scope.$watch('location.path()', function (path) {
$scope.statusFilter = (path === '/active') ?
{ completed: false } : (path === '/completed') ?
{ completed: true } : null;
$scope.statusFilter = { '/active': {completed: false}, '/completed': {completed: true} }[path];
});
$scope.$watch('remainingCount == 0', function (val) {
......
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