'use strict';

app.factory('Task', function(FURL, $firebase, Auth) {

	var ref = new Firebase(FURL);
	var tasks = $firebase(ref.child('task')).$asArray();
	var user = Auth.user;


	var Task = {
		all: tasks,

		getTask: function(taskId) {
			return $firebase(ref.child('tasks').child(taskId));
		},

		createTask: function(task) {
			task.datetime = Firebase.ServerValue.TIMESTAMP;
			return tasks.$add(task);
		},
		
	};


});
@@ -408,18 +408,180 @@
 );%0A%09%09%7D,%0A
+%0A
 %09%09
+editTask: function(task) %7B%0A%09%09%09var t = this.getTask(task.$id);%09%09%09%0A%09%09%09return t.$update(%7Btitle: task.title, description: task.description, total: task.total%7D);%0A%09%09%7D,
 %0A%09%7D;%0A%0A%0A%7D

add editTask