Pass multidimensional array from $http in AngularJS
<p>I have an array in AngularJS and I want to pass through <code>$http</code> to treat in PHP (back-end), but am unable to. I am able to pass <code>$scope.myForm.shopList</code> without any issues, but when I send <code>$scope.myForm</code> the php does not receive any data.</p>

<p>Angular:</p>

<pre><code>goSoft.controller('createShop', function($scope, $http){  
  $scope.myForm = [];
  $scope.myForm.shopList = [];

  $scope.shopListAdd = [{
    cod_prod : '',
    ref_prod : '',
    cant: '',
    fabricante : '',
    fecha_vence : '',
    vr_compra:'',
    vr_venta:'',
    iva:''
  }];

  $scope.add = function(shopAdd) {
    var index = $scope.shopListAdd.indexOf(shopAdd);
    $scope.shopListAdd.splice(index, 1);
    $scope.myForm.shopList.push(angular.copy(shopAdd))


    $scope.shopListAdd.push({
      cod_prod:'',
      ref_prod:'',
      cant: '',
      fabricante : '',
      fecha_vence : '',
      vr_compra:'',
      vr_venta:'',
      iva:''
    })
  }                

  $scope.submitForm = function(){    

    $http.post('../compras/objCompra.php?type=1', {datos:$scope.myForm}).success(
      function(data){
        console.log(data);
      })
  }})
</code></pre>

<p>PHP:</p>

<pre><code>$json = json_decode(file_get_contents("php://input"));
         print_r($json);
</code></pre>