Skip to content

Commit

Permalink
Merge pull request tastejs#636 from glebm/patch-1
Browse files Browse the repository at this point in the history
Remove ternary expressions
  • Loading branch information
sindresorhus committed Jul 26, 2013
2 parents 26bdbb2 + 2d92e70 commit 24c22e2
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 24c22e2

Please sign in to comment.