Created
June 18, 2014 14:30
-
-
Save strukturedkaos/19ddcc23496f0e893b05 to your computer and use it in GitHub Desktop.
Changing lists on Angular task list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Monitor the current route for changes and adjust the filter accordingly. | |
$scope.$on('$routeChangeSuccess', function () { | |
if ($routeParams.listId) { | |
var listId = $routeParams.listId.split("-").pop() | |
var list = lists[listId]; | |
if (list !== undefined && list !== $scope.currentList) { | |
$scope.currentList = list; | |
$scope.setTasks(); | |
} else if (list !== $scope.currentList) { | |
$location.path('/'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment