angular.js listen for keypress as shortcut for button

前端 未结 5 876
离开以前
离开以前 2021-01-02 08:03

My first ever angular application is a pretty basic survey tool. I have multiple choice questions, with a button for each answer and a basic function that logs each answer o

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-02 08:40

    If you insist on using AngularJS to detect the keypress event, ngKeypress is what you want to use.

    
    
    
    
    
    

    You can check out the documentation for ngKeypress for more information. You might also want to check out the ngKeydown and ngKeyup directives.

提交回复
热议问题