简体   繁体   中英

Using ng-keyup on non-input html tags

I have to use ng-keyup on some arrow keys. i am only able to use it on textarea and input type="text" tags.

I want to be able to use it on a div or body tag rather than the input tags so the user can just press arrow key when page loads to see the change. How do I do this?

Using AngularJS ngKeyup on a div rather than an input

I already tried using tabindex as is suggested by this answer but it didn't work.

通过将controller和ng-keyup都移到body标签上来工作。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM