Answer the question
In order to leave comments, you need to log in
What does the prefix document: mean when listening to events and where can I read about it?
In Angular, I faced the task of tracking keystrokes in a component and executing certain logic when certain keys are pressed.
For example, so that when you press the left or right arrows on the keyboard, the displayed photos scroll in the corresponding directions.
The problem is that if I just listen for 'keyup' or 'keydown' (or 'keyup.ArrowLeft' and 'keyup.ArrowRight'), then the logic doesn't work.
If I first add the text "document:" to the above key events, then everything works fine as intended.
There are examples here - https://stackoverflow.com/questions/42348837/angul...
Actually, I want to know where I can see the documentation on what kind of prefixes there are in general, in addition to "document:" and why the handler does not work without them?
Answer the question
In order to leave comments, you need to log in
The problem is that if I just listen for 'keyup' or 'keydown' (or 'keyup.ArrowLeft' and 'keyup.ArrowRight'), then the logic doesn't work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question