0

Pretty new to angular2 and I want to do something fun to get my feet wet.

I generated an app using the angular-cli and now I want a way to figure out if the user typed in the Konami code (up up down down left right left right b a enter).

What's the best way to do this? I'm familiar with events, observables, and would not mind learning a lot more. I asked a friend and they said I would probably have to bind a listener to the document so that's how far I got so far.

Thanks.

joshualan
  • 2,030
  • 8
  • 23
  • 32
  • check this question: https://stackoverflow.com/questions/36695922/angular-2-keyboard-events – Wandrille Oct 05 '17 at 20:25
  • Pretty easy with a directive. Check out my live sample: https://stackblitz.com/edit/konami-code?file=src%2Fapp%2Fkonami-code.directive.ts – NocFenix Aug 16 '18 at 14:18

0 Answers0