Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/434.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 获取Angularjs中ng按键上文本框的值_Javascript_Angularjs - Fatal编程技术网

Javascript 获取Angularjs中ng按键上文本框的值

Javascript 获取Angularjs中ng按键上文本框的值,javascript,angularjs,Javascript,Angularjs,我想获得按键时文本框的值 我有类似的html代码 <input style="width: 20%; float: right;" ng-model="que.SelectedOptionsUID" type="text" ng-keypress="myFunct($event)"/> 值位于下一项之后,表示将键入“a”,它将为空,然后键入“ab”,它将为“a” $scope.myFunct = function (e) {

我想获得按键时文本框的值

我有类似的html代码

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

值位于下一项之后,表示将键入“a”,它将为空,然后键入“ab”,它将为“a”
$scope.myFunct = function (e) {
    var charCode = (e.which) ? e.which : e.keyCode;
    //i want here value of the textbox 
}
<input style="width: 20%; float: right;" 
       ng-model="que.SelectedOptionsUID" 
       type="text" 
       ng-keypress="myFunct($event, que.SelectedOptionsUID)"/>
$scope.myFunct = function (e, myValue) {
    var charCode = (e.which) ? e.which : e.keyCode;        
    // do something with myValue
}