Utilizing AngularJS, I am seeking a method to retrieve the value from an input located within a specific row in a table.
Presented below is an input element. Upon clicking the "add" button, my objective is to extract the value corresponding to that particular row.
View
<tr ng-click="" ng-repeat='customer in customers | filter:query | orderBy: sort.field : sort.order'>
<td ng-repeat='field in fields'>
{{customer[field]}}
</td>
<td mult-ecs>
<p class="input-group">
<span class="input-group-addon">Rs</span>
<input class="form-control" name="debit" type="text" ng-model="customer['id'].value">
</p>
<button ng-click="addMulEcs(customer['id'])" class="btn btn-primary btn-sm" >Add</button>
<button ng-click="removeMulEcs(customer[id])" class="btn btn-danger btn-sm" >Remove</button>
</td>
</tr>
Controller
.directive('multEcs', ['$http', function($http){
return{
restrict: 'A',
replace:false,
scope:{
},
link: function(scope, elem, attr){
scope.addMulEcs = function(id){
}
}
}
}]);
Image of Table