I'm trying to calculate 2 values that the user typed in and set that result as the ng-model for another value. However I can't seem to get this code to work.
<input type="number" ng-model="a">
<input type="number" ng-model="b">
<input type="number" ng-init="c = a * b" ng-model="c">
I have also tried using parseFloat:
//in controller
$scope.parseFloat = parseFloat();
<input type="number" ng-init="c = (parseFloat(a) * parseFloat(b))" ng-model="c">
I CAN get the result I want as a label {{a * b | number:2 | currency}}
, but not as an ng-model. Any ideas?