i am starting to angularJS and i make a program to learn but i don't understand why i don't receive my $_POST variable when i sent
this my controller code
var ModalInstanceCtrl = function($scope,$http, $modalInstance, $modal, Name, Country, City) {
$scope.Name = Name;
$scope.City = City;
$scope.Country = Country;
$scope.ok = function (Name,Country,City) {
Country = 'test';
$http.post('requete.php', Country)
.success(function (reponse) {
$scope.PostDataResponse = reponse;
})
.error(function (status) {
alert(status);
$scope.ResponseDetails = "Data";
});
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
}
and this is my requete.php
<?php
header("Content-Type: application/json; charset=UTF-8");
var_dump($_POST);
echo 1;
?>
modal.html
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header-info">
<button type="button" class="close" ng-click="cancel()"></button>
<h4 class="modal-title">Envoyer un SMS</h4>
</div>
<div class="modal-body">
{{PostDataResponse}}
<div class="col-md-12">
<spam class="spamcenter">Nom : {{Name}}</spam>
<br>
<spam class="spamcenter">Pays : {{Country}}</spam>
<br>
<spam class="spamcenter">Ville : {{City}}</spam>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="cancel()">Close</button>
<button type="button" class="btn btn-primary" ng-click="ok(Name,Country,City)">Envoyer</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
and this is my response variable
<?php header("Content-Type: application/json; charset=UTF-8"); var_dump($_POST); echo 1; ?>
It returns me all the code of my file
i don't understand why and i don't see the trace of my POST in the console network
some one can help me please
thanks in advance