I want to submit to form with ng-repeat values for input text - but error where I submit it
HTML :
//there is html to view ng-repeat angular.js
<form method="post" ng-controller="FoodCtrl" ng-submit="addCart()">
<ion-item class="item-thumbnail-left" >
<img ng-src="" ng-click="" >
<p style="position:absolute;right:-25px;">
<!--INPUT HIDDEN-->
<input type="text" ng-model='x.id'>
<input type="text" ng-model='x.menu'>
<input type="text" ng-model='x.harga'>
<button type="submit" class="button button-balanced button-clear icon ion-android-cart"> </button>
</p>
<h2> {{x.menu}} </h2>
<p>Harga: Rp {{x.harga}}</p>
</ion-item>
</form>
JS:
Here is JS for controller angular.js
$scope.addCart = function() {
$http({
method : 'POST',
url : 'server/menu/add_cart',
headers : { 'Content-Type' : 'application/json' },
data : JSON.stringify({ id: $scope.id ,menu: $scope.menu , harga:$scope.harga })
}).success(function(data) {
console.log(data);
});
}