aboutsummaryrefslogtreecommitdiff
path: root/public/js/services/todoService.js
blob: 649c61fe62c5d4610c77389f261650ad0106bb59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
angular.module('todoService', [])

	// use the api
	.factory('Todos', ['$http', function($http) {
		return {
			get : function() {
				return $http.get('/api/todos');
			},
			create : function(data) {
				return $http.post('/api/todos', data);
			},
			delete : function(id) {
				return $http.delete('/api/todos/' + id);
			}
		}
	}]);