带离子形式的键盘事件 [英] Keyboard event with ionic form

查看:97
本文介绍了带离子形式的键盘事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < input type =search占位符=搜索 NG-模型= searchKey > 
< button class =button button-clearng-click =search()>搜索< / button>

我想添加一个调用函数search()的事件,当我按Enter按钮我的键盘。



有什么建议吗?



提前谢谢你

解决方案

您可以使用此指令 ng-enter ,像这样

 < input type =search占位符=搜索ng-enter =搜索()ng-model =searchKey> 


I have an input field in my ionic form:

<input type="search" placeholder="Search" ng-model="searchKey">
<button class="button button-clear" ng-click="search()">Search</button>

And I wanna add an event that calls the function "search()" when I press enter button of my keyboard.

Is there any suggestion ?

Thank you in advance

解决方案

You can use this directive ng-enter, like this

<input type="search" placeholder="Search" ng-enter="search()" ng-model="searchKey">

这篇关于带离子形式的键盘事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆