What is the easiest way to stop mouse events propagation in Angular ?
Should I pass special $event
object and call stopPropagation()
myself or there is some other way.
For example in Meteor, I can simply return false
from event handler.
The simplest is to call stop propagation on an event handler. $event
works the same in Angular 2, and contains the ongoing event (by it a mouse click, mouse event, etc.):
(click)="onEvent($event)"
on the event handler, we can there stop the propagation:
onEvent(event) {
event.stopPropagation();
}