View source Improve this doc

# `ngKeypress`
directive in module `ng`

## Description

Specify custom behavior on keypress event.

## Usage

as attribute

    <ANY ng-keypress="{expression}">
       ...
    </ANY>

as class

    <ANY class="ng-keypress: {expression};">
       ...
    </ANY>

#### Parameters

Param | Type | Details
--- | --- | ---
ngKeypress | expression | Expression to evaluate upon keypress. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)

## Example

See `ngClick`