Попытка отправить данные с несколькими записями, но только одна запись отправляется в базу данных. Даже не удалось получить количество строк в angularjs. Как я могу отправить несколько строк в AngularJS, используя javascript?
Возможность видеть данные в состоянии тревоги, но не может быть отправлена в базу данных
$scope.insupdOrderDetailsJS = function() {
$scope.orderDetails.center_name = document.order_data.center_name.value;
$scope.orderDetails.vendor_name = document.order_data.vendor_name.value;
$scope.orderDetails.po_num = document.order_data.Po_No.value;
for (var i = 1; i < 3; i++) {
alert(i);
var i_val = $("#item_name-" + i).val();
alert(i_val);
var o_val = $("#order_quantity-" + i).val();
alert(o_val);
var r_val = $("#rate-" + i).val();
alert(r_val);
var t_val = $("#tax_percentage-" + i).val();
alert(t_val);
var tt_val = $("#bill_amount-" + i).val();
alert(tt_val);
google.script.run.withSuccessHandler($scope.gotList4).withFailureHandler($scope.errorCallback).insert_order(
i_val,
$scope.orderDetails.vendor_name, o_val,
$scope.orderDetails.po_num, r_val, t_val, tt_val,
$scope.orderDetails.center_name
);
}
}
Фрагмент -
<table class="table table-striped table-bordered">
<thead>
<tr>
<th><input type="checkbox" ng-model="selectedAll" ng-click="checkAll()" /></th>
<th>Item_Name</th>
<th>Quantity</th>
<th>Rate</th>
<th>Tax</th>
<th>Bill Amount</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="personalDetail in personalDetails" ng-blur="bill_amount()" id="{{$parent.$id+'-'+$index}}">
<div>
</div>
<td>
<input type="checkbox" ng-model="personalDetail.selected" /></td>
<td>
<input type="text" name="item_name" ng-click="complete()" id="item_name-{{$index+1}}" class="form-control " ng-model="personalDetails.item_name" required>
<ul class="ul-TS" ng-model="hidethis" ng-hide="hidethis">
<li class="li-TS" ng-repeat="item in filterCountry " ng-click="fillTextbox(item)" value="{{item.item_name}}">{{item}}</li>
</ul>
<td>
<input type="text" class="form-control " ng-model="personalDetail.qty" name="order_quantity" id="order_quantity-{{$index+1}}" required /></td>
<td>
<input type="text" class="form-control " ng-model="personalDetail.rate" id="rate-{{$index+1}}" required /></td>
<td>
<input type="text" class="form-control " ng-model="personalDetail.tax" id="tax_percentage-{{$index+1}}" required /></td>
<td>
<input type="text" class="form-control " ng-model="personalDetail.bill" id="bill_amount-{{$index+1}}" required /></td>
</tr>
</tbody>
</table>