0
私はconsole.logに表示されませんでした$scope.value
クリックした後に数字を選択した入力から。入力からの数値AngularJS
マイコード:
<table class="table table-bordered table-striped">
<thead>
<tr>
<th >Name
<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 style="width:35px;">{{n.system}}</td>
<td><input class="form-control input-sm" type="number" name="input" ng-model="value"
min="0" max="100" style="width:55px;">
</td>
</tr>
</tbody>
</table>
<button ng-click="postapi()">Value</button>
Plunker:事前に答えをhttp://plnkr.co/edit/g1t4pludTTIAJYKTToCK?p=preview
ありがとう!
なぜデータのすべての要素を 'value'にバインドしたいのですか?代わりに' ng-model = "n.value" 'のような独自の値に各要素をバインドする' ng- model = "value" '?あなたのアプローチでは、 'data'のすべての項目に対して同じ値を持ちます – codtex