Created
June 18, 2014 14:33
-
-
Save strukturedkaos/027c9ca2f668fc86dc2f to your computer and use it in GitHub Desktop.
addList function in 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
$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