-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTasksFactory.js
More file actions
50 lines (29 loc) · 897 Bytes
/
Copy pathTasksFactory.js
File metadata and controls
50 lines (29 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var serviceId = 'TasksFactory';
angular.module('GoogleTasks').factory(serviceId,
['$http', TasksFactory]);
function TasksFactory($http) {
function getTaskLists() {
return $http.get('/api/defaultTasklist');
}
function getAllTasks() {
return $http.get('/api/task/AllTasks');
}
function deleteTask(id) {
return $http.delete('/api/task/DeletedTask/'+id );
}
function deleteAllTasks() {
return $http.delete('/api/task/ClearAllTasks');
}
function insertTask(_title, _note) {
var data = { title: _title, note: _note };
return $http.post('/api/task/InsertTask', data);
}
var service = {
insertTask: insertTask,
deleteAllTasks: deleteAllTasks,
deleteTask: deleteTask,
getAllTasks: getAllTasks,
getTaskLists: getTaskLists
};
return service;
}