aboutsummaryrefslogtreecommitdiff
path: root/public/js/services/todoService.js
blob: a51db95a7779ad1d21338a099330e1eb7e8261c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
angular.module('todoService', [])
  .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);
          }
      }
  }]);