我嘗試從輸入號碼中console.log表中的每個值,但我只收到10
- script.js中分配的值。我不想console.log這個值,你在輸入數字中選擇。 我plunker:http://plnkr.co/edit/g1t4pludTTIAJYKTToCK?p=previewng-model輸入類型的值= ng-repeat中的數字AngularJS
代碼:
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Name</th>
<th>System </th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="n in data">
<td style="word-break:break-all;">{{n.name}}</td>
<td>{{n.system}}</td>
<td>
<input class="form-control input-sm" type="number"
name="input" ng-model="value" min="0" max="100">
</td>
<td>
<button ng-click="postvalue()">Value</button>
</td>
</tr>
</tbody>
</table>
感謝提前答案!
值屬性添加到您的每一個對象,並且您輸入綁定當前對象的值:'n.value'。 –