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
  • 53,428
  • 11
  • 128
  • 150
An-droid
  • 6,433
  • 9
  • 48
  • 93

1 Answers1

0

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

Alexis
  • 5,681
  • 1
  • 27
  • 44