Created
September 5, 2014 12:12
-
-
Save sivaprasadreddy/746449a4623d12cf37d1 to your computer and use it in GitHub Desktop.
TodoService-1.js
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
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