Key capture directive not working as intended in Angularjs -


i trying capture keypress events in angular app. intended functionality upon pressing g1 (i.e simulataneously pressing g , 1) app should transition state1. upon pressing g2 app should transition state2 , on.

however app not seem capturing 2 keypresses simulataneously. missing here ? best way achieve or there better solutions available.

you can see plnkr here http://plnkr.co/edit/sk0nyndrth4lfftend5o

you pass e.codevalue service/controller stores keys pressed in array.

on key press up, tell service/controller remove "key pressed" array.

in service/controller, can use logic see if g , 1 in array - if are, state transition. work, although not 100% if it's best way. give try , let know if worked you.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -