suman goud

suman goud

  • NA
  • 176
  • 50.9k

drop down id not getting if i give ng-repeat in mvc Angular

Sep 20 2016 1:33 AM
am adding table row on changing of dropdown,
<tr ng-repeat="r in rvm" >
<td>
<select ng-model="Customer.ID" ng-options="c.ID as c.Name for c in customer" ng-change="GetAccountBalance($index)" style="width:150px;height:22px;" name=" tCustomer">
<option value="">Select Customer</option>
</select>
</td>
<td>
<input type="text" ng-model="AdjustAmount" name="tPendingAdjusted" />
</td>
<td>
<input type="text" ng-model="ReceiptsViewModel.AdjustAmount" name="tAmount" />
</td>
<td>
</tr>
JS
$scope.rvm = [{}];
$scope.GetAccountBalance = function (index) {
var getAccountBalance = ReceiptsService.GetAccountBalance($scope.ID);
var id = $scope.ID;
alert(id);
if ($scope.rvm.length == (index + 1)) {
$scope.rvm.push({
});
}
am able to add new row by using this code on dropdown change, but am not getting selected dropdown id(alert:undefined)
if i comment ng-repeat in tr , am getting id but not adding row
how to get id on ng-repeat

Answers (8)