简单有效的方法,随笔记录一下
在html设置id
<input id="search_sim" type="text" class="form-control w-xxl" ng-model="queryObj.search" >
然后再js中设置相应的绑定事件
$('#search_sim').bind('keypress',function(event){//监听sim卡回车事件
if(event.keyCode == "13")
{
$scope.doSearchSim();
$scope.refresh();
}
});
当然,可以将bind改为on试试,也是一样的效果