Javascript 获取Angularjs中ng按键上文本框的值
我想获得按键时文本框的值 我有类似的html代码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) {
<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
}