I have experience binding to events using the HostListener decorator, as shown below:
@HostListener('document:mousemove', ['$event'])
onMousemove(event) {
//Handling mouse movement.
}
However, I am looking for a way to dynamically bind and unbind the mousemove event during different stages of a component's lifecycle. I am unsure of what this type of binding is referred to as and have been unable to find any information on it. Should I consider utilizing native JavaScript event binding instead?