Commit 2d92e706 authored by Gleb Mazovetskiy's avatar Gleb Mazovetskiy

Remove ternary expressions

A more readable and scalable approach
parent 26bdbb2d
......@@ -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