Get value of textbox on ng-keypress in Angularjs

Problem

I want to get the value of the textbox on keypress.

I have html code like

<input style="width: 20%; float: right;" 
       ng-model="que.SelectedOptionsUID" 
       type="text" 
       ng-keypress="myFunct($event)"/>

And JS code on my controller:

$scope.myFunct = function (e) {
    var charCode = (e.which) ? e.which : e.keyCode;
    //i want here value of the textbox 
}
Problem courtesy of: sagar43

Solution

<input style="width: 20%; float: right;" 
       ng-model="que.SelectedOptionsUID" 
       type="text" 
       ng-keypress="myFunct($event, que.SelectedOptionsUID)"/>

Controller:

$scope.myFunct = function (e, myValue) {
    var charCode = (e.which) ? e.which : e.keyCode;        
    // do something with myValue
}
Solution courtesy of: devqon

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.