I'm quite new to angular.js. Now I try to post some data to a PHP-Script.
angular.js:
var app = angular.module('app', []);
app.controller('sendData', function($scope, $http) {
$http.post("script.php", {'value': 'one'} )
.success(function (response) {
console.log(response);
});
});
PHP:
$data = json_decode(file_get_contents("php://input"));
So I would get the data in $data->value
.
Is it possible to modify the script (without using $.param of JQuery), so I could access the post-data with $_POST['value']
- as I would normally do that in PHP?