Created
August 25, 2017 21:57
-
-
Save codemwnci/451a5fdffe0147461eecf9c2d688b0fe to your computer and use it in GitHub Desktop.
delete todo function
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
deleteTodo: function(id) { | |
axios.delete("http://localhost:9000/todo/"+id).then(response => { | |
if (response.data = "ok") { | |
for(var i = this.todos.length; i--;){ | |
if (this.todos[i].id === id) this.todos.splice(i, 1); | |
} | |
} | |
}); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment