I am using angular js. I want to get value from input inside a row in table.
Below there is an input element. When i click the button (add) i need to get the value for 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