Thursday, March 26, 2015

AngularJS Keyboard Events

AngularJS provides a set of events to handle user interactions in the UI layer, AngularJS events can be broadly classified into the following 3 categories.

Change Events – To handle triggered from controls like TextBox, Dropdown, checkbox etc.
Keyboard Events – To handle events triggered by user typing keys in the keyboard.
Mouse Events – To handle mouse events like mouse_up, mouse_down, etc

In this post we shall see on the various possible keyboard events provided by AngularJS.

AngularJS provides ng-keyup, ng-keydown & ng-keypress directive to handle appropriate keyboard events, these events are triggered when user preforms the corresponding action in the UI.

The events are handled by assigning a function to each of these directives, and passing the $event as parameter to the function, as follows.


In the following post we shall see on how to handle each of these events.

Search Flipkart Products:

No comments: