Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="http://code.angularjs.org/angular-1.0.1.js"></script>
<div ng-controller="MyCtrl">
<input type='text' ng-model='input' ng-click="myFunction(2)">
</div>
JavaScript
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.input = 1;
$scope.myFunction = function(value) {
$scope.input = value;
}
}