2015-01-06 3 views

답변

6
<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 
} 
+0

값은 다음 항목 다음에 오는 하나는 것이라고 말할

나는 HTML 코드 내 컨트롤러

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

그리고 JS 코드처럼이 "a"를 입력하면 null이오고 "ab"를 입력하면 "a"가옵니다. –

관련 문제