下面的onclick angularjs是我的html:如何发送输入文本框的值在文本框中
<tr ng-repeat="c in client">
<td><input type =text id = "id" value = {{c.id}} onclick = "display();" > </input> </td>
<td><input type =text value = {{c.fname}}></td>
</tr>
我的JS:
function display()
{
var x=document.forms["form"]["id"].value;
alert(x);
}
我得到的警告框的输入值但是如何在另一个angulr js函数中获得这个值。我想下面的代码BT不工作,请给我建议
<input type =text id = "id" value = {{c.id}} ng-model = user.id ng-click ="init(user)" > </input>
您的控制器代码在哪里? – SamV