Skip to content

Instantly share code, notes, and snippets.

@strukturedkaos
Created June 18, 2014 14:33
Show Gist options
  • Save strukturedkaos/027c9ca2f668fc86dc2f to your computer and use it in GitHub Desktop.
Save strukturedkaos/027c9ca2f668fc86dc2f to your computer and use it in GitHub Desktop.
addList function in Angular task list
$scope.addList = function() {
var newList = $scope.newList.trim();
if (!newList.length) {
return;
}
lists.push({
listId: Slug.slugify(newList + '-' + lists.length),
title: newList,
tasks: [],
remainingCount: 0
});
$scope.newList = '';
$scope.currentList = lists[lists.length - 1];
$scope.setTasks();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment