I try to send a handsontable table data using $http POST with Angulars.js The code below:
var $container = $("div#table");
var handsontable = $container.data('handsontable');
$scope.saveData = function() {
$http.post('save.php', {'data':handsontable.getData()}).success(function(res,status) {
if (res.result === 'ok') {
console.log('Data saved');
}
else {
console.log('Save error');
}
});
}
But I get a 'Save error' with
Undefined index: data in <b>C:\xampp\htdocs\angular\save.php
I the development tool in Chrome I get Request payload of this form:
{"data":[[fdf,gsgg,gsg,null,null,null],[sgsg,sgg,sgg,ggs,null,null]]}
I changed parameters in $http.post to get it work but no solution, Thank you to give some advices!!!