我正在使用AngularJS发送$http.post
请求
这是我的AngularJS代码:
var app = angular.module('myApp', [],function($httpProvider)
{
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
});
app.controller('notificationsCtrl', function($scope, $http) {
$http.get("listAllNotifications.php")
.then(function (response) {$scope.notifications = response.data.records;});
$scope.removeRow = function (row)
{
var parameter = JSON.stringify({'actions': row});
$res = $http.post("../api/notifications.php",parameter)
.then(function (response) {$scope.notifications = response.data.records;});
}
});
这是接收它的PHP服务器端代码:
<?php
print_r($_POST,TRUE);
这是打印结果:
{&#34;动作&#34;:1450591689} =&#34;&#34;
在key=>value
$_POST
作为ComponentRef
,我做错了什么?
感谢