I am having trouble getting it to save the values. I'm struggling to understand the onbeforesave documentation completely. Here is my code, but unfortunately, it doesn't seem to be working.
html
<div class='title' editable-text='task.title' onbeforesave="updateTitle(task)">
{{task.title}}
</div>
js
var app = angular.module('Todolist', ['ngResource', 'xeditable']);
app.factory('Task', [
'$resource', function($resource) {
return $resource('/users/:user_id/tasks/:id', {user_id: '@user_id'}, {update: {method: 'PUT'}});
}
]);
app.controller('TasksCtrl', [
'$scope', 'Task', function($scope, Task) {
$scope.user = gon.current_user
$scope.updateTitle = function(task) {
id: task.id,
Task.update(task);
}
}
]);