The ng-keydown Directive in AngluarJS is used to apply custom behavior on a keydown event. It is supported by <input>, <select> and <textarea> elements.
<element ng-keydown="expression"> Contents... </element>
Example: This example uses ng-keydown Directive to change the background color after pressing the button.
Before pressing the button:
After pressing the button:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.