Very confusing because I tried a lot of ways around it and all seem messy.
The view
<select ng-model="somemodel" ng-options="val as val.name for val in vals" ng-init="somemodel=vals[2]"></select>
<input type="number" ng-model="somemodel.value" min="{{somemodel.min}}" max="{{somemodel.max}}">
{{somemodel.value}}
The controller
function appCtrl($scope) {
$scope.somemodel = "";
$scope.vals = [
{name:"a", min:"1", max:"10", value:4},
{name:"b", min:"10", max:"20", value:14},
{name:"c", min:"21", max:"31", value:24},
{name:"d", min:"31", max:"41", value:34}];
}
When i change the select, it updates the model, but not the input. Whereas if i change the input it also updates the model. How can i get select to update view for the input in an AngularJS way?
Here the situation is demonstrated: http://jsfiddle.net/rq8qs/4/
Update: updated the fiddle
update2: changed value into number type
WORKAROUND http://jsfiddle.net/rq8qs/10/
min/max-Validator(line 16020 and following) are allways one digest behind. This is observable if you logvar min = parseFloat(attr.min);. I'd say this could be called a bug, for I can't find any documentation describing this as intended.