我正在使用服务来更新数据库表.
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;
}
};
});
Run Code Online (Sandbox Code Playgroud)
PHP
public function create()
{
print_r($_POST);
}
Run Code Online (Sandbox Code Playgroud)
数组返回空.我错误地传递了数组吗?
Chrome Dev

谢谢
| 归档时间: |
|
| 查看次数: |
6343 次 |
| 最近记录: |