1. i have used angualr js and developing a mini app for crud operation i ma facing issue while i send a post request it shows posted value in fireug console as shown in image1 but while trying to same using $_REQUEST or $_POST it returns blank array

Explanation..

in product.js

app.controller('productsCtrl',function($scope,Data){ 
$scope.changeStatus=function(product){
        $scope.status = {};
        $scope.status.status = product.status=='Active' ? 'Inactive' : 'Active';
        //Data.put('http://localhost/angularCrud/products.php',$scope.status);
        Data.put('http://localhost/angularCrud/test.php',$scope.status);
    };
});

in data.js

app.factory('Data',['$http','$location',function($http){ 
    var obj={};
obj.put=function(q,param){ //console.log(data);
    //$http.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
      successData = $http.post(q,param).success(function(response){
        console.log(response);
        return response;
      });
};

    return obj;
}]);
pranav88raval Default Asked on December 1, 2015 in Programming.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.