I have a JSON data getting from server.
$scope.denominations = [
{
"code": "190",
"description": "One Coin",
"count": null,
"multiplier": 1
},
{
"code": "170",
"description": "Five Coin",
"count": null,
"multiplier": 5
},
{
"code": "150",
"description": "Strapped 2",
"count": null,
"multiplier": 200
}
]
view
<table class="custom-table table-bordered table">
<tr>
<th>Denomination</th>
<th class="text-center">Amount</th>
</tr>
<tr data-ng-repeat="denom in denominations">
<td class="centerText"><input type="text" class="form-control" name="denomCount" data-ng-model="denom.count" readonly></td>
<td class="centerText"><input type="text" class="form-control" name="denomamount{{$index}}" data-ng-model="(denom.count != 'null') ? (denom.count * denom.multiplier) : '0.00'"></td>
</tr>
</table>
Based on the condition, i need to set the value of input text box. the conditions are i added in the model, but it is giving error saying: non assign model value
data-ng-model = "if (denom.count != 'null') ? (denom.count * denom.multiplier) : '0.00'"