【发布时间】:2017-07-08 01:50:39
【问题描述】:
我正在使用 Angular 1.6.2 WHIT PHALCON
$scope.selectAction = function(Item){
$http({
method: 'GET',
url: 'Mycontroller/new',
params : {Item : Item},
headers : {'Accept' : 'application/json'}
}).then(function successCallback(res) {
// this callback will be called asynchronously
// when the response is available
console.log("DATOS : "+res.data.res);
$scope.lista_premisos = res.data.res;
}, function errorCallback(data) {
// called asynchronously if an error occurs
// or server returns response with an error status.
console.log(data);
}); }
当我拿起我的控制器时,它不会返回任何东西
public function newAction()
{
//si es una petición get
if($this->request->isGet() == true)
{
$this->view->disable();
$id = $this->request->getPost("Item");
$this->response->setJsonContent(array('res' => array($id)));
$this->response->setStatusCode(200, "OK");
$this->response->send();
} }
角度版本也有问题。
我做错了,请帮忙。
【问题讨论】: