Answer the question
In order to leave comments, you need to log in
How to not call parent (click) in angular cli?
Good day! There is a list of elements, when clicking on each element, its detailed description is revealed using (click)="showElement()". But in the list of elements there is a button, when clicked, I would like to perform another action without triggering showElement. Is it possible to do this? Example
<li (click)="showElement()">
<h2>Название элемента</h2>
<button class="btn_buy btn_buy_filtered" (click)="toCart()">
<i class="fa fa-shopping-cart"></i> В корзину
</button>
</li>
Answer the question
In order to leave comments, you need to log in
try
<button class="btn_buy btn_buy_filtered" (click)="toCart(); $event.stopPropagation()">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question