Photo by Ricardo Resende on Unsplash

Angular: Long Press Directive with RxJS

Ankit Rana

--

I going to share with you, Long press directive implementation in RxJS. In this implementation, we will start the emitting Output event, when the user presses the mouse button for a specified threshold limit.

Update: Add touch event for touch devices, and to make things working, make sure the button or element, on which the user wants to long-press event to trigger, is non-selected.

Please provide your feedback on this. Here working example

--

--

Ankit Rana

I am Code Writer, dreamer :), java-script developer and Architecture enthusiastic.