У меня есть таблица, в которой я перечисляю некоторые продукты с некоторыми входными данными, в основном я хочу изменить входное значение при изменении другого, вот <tr>
:
<tr ng-repeat="bought_product in vm.bought_products track by bought_product.id">
<td>
{{ bought_product.name }}
</td>
<td>
<input type="number" class="form-control"
min="1" max="1000" placeholder="#"
ng-model="bought_product.quantity">
</td>
<td>
<div class="input-group">
<span class="input-group-addon">$</span>
<!-- This is the input where I'll insert a price -->
<input type="number" class="form-control no-spin"
min="1" max="1000" placeholder="#" ng-change="vm.calculateVatPrice(bought_product.price)"
ng-model="bought_product.price">
</div>
</td>
<td>
<div class="input-group">
<span class="input-group-addon">$</span>
<!-- This input will automatically be filled -->
<input type="number" class="form-control no-spin"
min="1" max="1000" placeholder="#"
ng-model="bought_product.vat_price">
</div>
</td>
</tr>
$scope.bought_product.vat_price
на$scope.vm.calculateVatPrice(bought_product.price)
. - person Johannes Jander   schedule 08.01.2016ng-repeat
, поэтомуbought_product.vat_price
- это не простое значение, которое можно изменить с контроллера. - person Jonathan Solorzano   schedule 08.01.2016