Last active
August 29, 2015 14:05
-
-
Save steinbring/3365a5e4d48d90bef071 to your computer and use it in GitHub Desktop.
How I implimented Add, Delete, and Clone for 'Notes Vault'
This file contains 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.removeItem = function() { | |
$scope.$storage.notes.splice(document.getElementById('selectedNote').value, 1); | |
document.getElementById('title').value = ''; | |
document.getElementById('content').value = ''; | |
} | |
$scope.addItem = function() { | |
$scope.$storage.notes.push({ | |
"title": "", | |
"content": "" | |
}); | |
} | |
$scope.cloneItem = function() { | |
$scope.$storage.notes.push({ | |
"title": document.getElementById('title').value, | |
"content": document.getElementById('content').value | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment