I'm building app in symfony2.4 and angularjs. In angular I've created resource:
app.factory('Tasks', ['$resource', function($resource) {
return $resource( 'api/tasks/:taskid', null,
{
'update': { method:'PUT' }
});
}]);
and when I'm trying to update like this: Tasks.update({ taskid : task.id },task);
I'm getting this error:
{"code":400,"message":"Validation Failed","errors":{"errors":["The CSRF token is invalid. Please try to resubmit the form."],"children":{"timeStart":{"children":{"date":[],"time":[]}},"timeStop":{"children":{"date":[],"time":[]}},"project":[],"descriptionTask":[],"isCompleted":[],"isVisible":[]}}}
When I build form in symfony and then update any task - it works. But I noticed that AngularJS doesn't send any data via POST. It sends via JSON(? or just sends this object I'm giving ) and I think this is the problem. How can I repair it?