I have an input text with a table in which I filter some values from a JSON with an ng-repeat in meanwhile I'm typing.
<input type="text" placeholder="Choose" ng-model="item.sTxt"/>
<table>
<thead>
<tr>
<th>First Value</th>
<th>Second Value</th>
</tr>
</thead>
<tbody>
<tr
data-ng-repeat="item in numberList.getList | filter:searchText"
ng-click="setSelected(item.last)">
<td>{{item.first}}</td>
<td>{{item.last}}</td>
</tr>
</tbody>
</table>
I can show an alert when I click a row in the table in this way:
$scope.idSelectedVote = null;
$scope.setSelected = function (idSelectedVote) {
$scope.idSelectedVote = idSelectedVote;
alert(idSelectedVote);
};
but i would take that value and pass it in my input text. How could i do it in angularjs?