Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Latest commit

 

History

History
41 lines (27 loc) · 806 Bytes

ng.ng-keyup.md

File metadata and controls

41 lines (27 loc) · 806 Bytes

ng-keyup

  • Angular@1.4.7
  • ng 模块中的指令

keyup 事件指定之定义行为。

指令信息

这个指令的执行优先级为0级

用法

用作属性:

<ANY ng-keyup="expression">
...
</ANY>

参数

参数 形式 详细
ngKeyup expression 通过键弹起操作触发需要解析的表达式(事件对象可以通过 $event 获得获得并且有 keyCodealtKey

例子

index.html

<p>Typing in the input box below updates the key count</p>
<input ng-keyup="count = count + 1" ng-init="count=0"> key up count: {{count}}

<p>Typing in the input box below updates the keycode</p>
<input ng-keyup="event=$event">
<p>event keyCode: {{ event.keyCode }}</p>
<p>event altKey: {{ event.altKey }}</p>