× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Pass value from table to input text Angularjs

Mar 05, 2015
<p>you can use ng-model to create a model on text input, then just pass the value of clicked table row to that model, like this</p> <pre><code>&lt;input ng-model='input' type="text" placeholder="Choose"/&gt; $scope.setSelected = function (idSelectedVote) { $scope.idSelectedVote = idSelectedVote; $scope.input=idSelectedVote; //alert(idSelectedVote); }; </code></pre> <p></p><hr> Also if you want to filter out the repeated list, you can use the same model, in the filter.<p></p> <p>you can see this <a href="http://jsfiddle.net/HB7LU/11305/" rel="nofollow"><strong>Fiddle</strong></a>, it does both filter on input and place text in input on click of tr</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/28760971/Pass%20value%20from%20table%20to%20input%20text%20Angularjs/28761095">Stack Overflow</a>.</p>
comments powered by Disqus