Skip to content

Instantly share code, notes, and snippets.

@steinbring
Last active August 29, 2015 14:05
Show Gist options
  • Save steinbring/3365a5e4d48d90bef071 to your computer and use it in GitHub Desktop.
Save steinbring/3365a5e4d48d90bef071 to your computer and use it in GitHub Desktop.
How I implimented Add, Delete, and Clone for 'Notes Vault'
$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