I have a directive that listens to some events using the host
property of the @directive
decorator. This works great, but I don't need all events at all times.
For example, I'm only interested in (document: mouseup)
at certain times (namely after a mousedown on my element).
What is the angular way to register and unregister to events dynamically?
See Question&Answers more detail:os