本文介绍了如何在Android上的angular中获取按键事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Android的Angular中获取按键事件及其值?我使用phonegap Cordova Angular JS
How do we get the keypress event and its value in Angular on Android?I Use the phonegap Cordova Angular JS
<form name="myForm">
<input type="search" name="userName" ng-model="user" class="search-input" style="width: 96%; margin: 6px auto 6px auto;" placeholder="Начните вводить название">
</form>
</div>
</div>
user = {{user}}
我们非常感谢您的帮助.
Any help is really appreciated.
推荐答案
<form name="myForm">
<input type="search"
name="userName"
ng-model="user"
ng-keypress="yourMethod(user)" class="search-input"
style="width: 96%; margin: 6px auto 6px auto;"
placeholder="Начните вводить название">
</form>
user = {{user}}
更新:
<input type="search" name="userName" ng-model="user" ng-change="getValue(user)" class="search-input" style="width: 96%; margin: 6px auto 6px auto;" placeholder="Начните вводить название">
还有我的控制器$scope.getValue = function (calll) { alert(calll); }
这篇关于如何在Android上的angular中获取按键事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!