Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TodoService-1.js
var myApp = angular.module('myApp');
myApp.factory('TodoService', function($http){
return {
loadTodos : function(){
return $http.get('todos');
},
createTodo: function(todo){
return $http.post('todos',todo);
},
deleteTodo: function(id){
return $http.delete('todos/'+id);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.