I have two input types: "range" and "number". If I change the number using the input field, the value is updated in the header and at the range slide. However, I also would like to update the value in my input field, if I change it using the range slide. Right now, only the value in the header is updated.
HTML
<div ng-app>
<div ng-controller="amountController">
<h2>{{"Amount: " + amount + "$"}}</h2>
<div class="row">
<div class="item range" id="index3-rangeAmount"> <i>5000$</i>
<input type="range" name="volume" min="5000" max="50000" value="{{amount}}" ng-model="amount"> <i>50000$</i>
</div>
<div>
<input type="number" id="index3-inputAmount" min="5000" max="50000" value="{{getAmount()}}" ng-model="amount">
</div>
</div>
</div>
Javascript
function amountController ($scope) {
$scope.amount = 7500;
$scope.getAmount = function() {
return $scope.amount;
};
}
Here is the link to the jsfiddle: jsfiddle