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 ?

0

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.