AngularJS custom ngBindModel directive
Bind ngModel to a variable whose name is stored inside another variable.
HTML
<script src="http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>
<!doctype html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8" />
<title>My AngularJS App</title>
</head>
<body ng-controller="stageController">
<form name="myForm" novalidate="">
<input type="text" name="myText" ng-bind-model="model" />
</form>
<a ng-click='change();'>Change</a>
</body>
</html>
CSS
input {
width:240px;
padding:2px 4px;
}