我正在使用服务来更新数据库表。
myApp.factory('createGal', function ($http, $q)
{
return {
createGal: function()
{
var deferred = $q.defer();
var newGalleryArray = {};
newGalleryArray.galleryName = 'New Image Gallery';
newGalleryArray.client = 245;
$http.post('/beta/images/create', {newGalleryArray: newGalleryArray}).success(function(data)
{
console.log(data);
deferred.resolve(data);
});
return deferred.promise;
}
};
});
PHP
public function create()
{
print_r($_POST);
}
阵列被返回空。我错误地传递数组?
Chrome浏览器开发
感谢
控制台对请求的说明是什么? – tymeJV
成功,请求。返回数据库操作,只是不在POST中发送的数组 – Bungdaddy
有趣...您的PHP发送回来了什么? – tymeJV