I am currently using angularjs v1.0.7 and facing an issue with a hidden form field whose value is related to another input value. In the example provided at http://jsfiddle.net/4ANaK/, the hidden field does not update as I type in the text input field.
<div ng-controller="MyCtrl">
<form ng-submit="action()">
name:<input ng-model="name" type="text" value="your name">
<input ng-model="nice_name" type="hidden" value="Mr {{name}}" >
<input type="submit">
</form>
</div>
var app=angular.module('myApp', []);
function MyCtrl($scope) {
$scope.name = "David";
$scope.action = function(){
alert($scope.nice_name);
}
}
Can anyone help me fix this problem?