按Enter键而不是鼠标单击(Angular modal- Plunker附加)

时间:2016-03-21 19:24:09

标签: javascript angularjs twitter-bootstrap modal-dialog bootstrap-modal

http://plnkr.co/edit/v3NWuyIP2M9tcRG1qT7j?p=preview

根据plunker,如果我点击“打开我”按钮,会出现一个模态并要求用户按输入。完成后,用户必须使用鼠标单击确定才能继续操作。

有人可以通过键盘输入而不是使用鼠标让我知道如何继续进一步操作。有什么办法吗?

<div class="modal-body">
        Check User ID: <input type="text" ng-model="data.User_ID">
</div>

1 个答案:

答案 0 :(得分:3)

在您的输入上添加

arr.join(" ")
  #=> "1. stuff 2. things 3. people 4. places"

当输入命中

时,这将调用ok方法