0
<div (click)="parentAction()"> 
    <div (click)="childAction()"></div>
</div>

I want to trigger childAction only here but both parentAction and childAction is getting executed. How can I stop parentAction in this?

Maximilian Riegler
  • 22,720
  • 4
  • 62
  • 71
Prajeet Shrestha
  • 7,978
  • 3
  • 34
  • 63

1 Answers1

3
<div (click)="parentAction()"> 
    <div (click)="$event.stopPropagation();childAction()"></div>
</div>
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567