0

I have a list of elements.

Each element have a global click event and a child icon which should also be clickable.

Example :

<div class="parent-element" (click)="clickParent()">
   <span class="button" (click)="childClick()">
   </span>
</div>

For now when I click on the span, both click are fired. How can I separate it from the parent click event ?

Erik Philips
  • 51,408
  • 11
  • 123
  • 146
An-droid
  • 6,209
  • 6
  • 42
  • 87

1 Answers1

0

Catch the event on both methods (parent and child) and call event.preventDefault() or event.stopPropagation()

Alexis
  • 5,481
  • 1
  • 26
  • 43