I want to call a php method using angular service. I do this :
save:function(){
var req = {
method: "GET",
url: "/api/save/",
data: {
nom:"nom"
}
}
var deferred = $q.defer();
$http(req).
success(function(result) {
console.log(req);
deferred.resolve(result);
})
and in my php controller :
public function savePersonnelAction(Request $httpRequest){
$content= $httpRequest->query->get('data');
return $this->render('clientBundle:Default:index.html.twig',array('content'=>$content));
}
But I have an empty object as a result.
Can someone help me to resolve this problem please