ngx-propagation-stop
v2.0.29
Published
Stop Click Propagation on any Element.
Downloads
296
Readme
ngx-propagation-stop
A npm-packet for a stopping Click Event Propagation.
Installation
Install from NPM
$ npm install ngx-propagation-stop --save
Do not forget to add it to your app.module.ts:
import { PropagationStopModule } from 'ngx-propagation-stop';
@NgModule({
imports: [
PropagationStopModule
]
})
How to use
Just add the propagationStop
directive to your element and the outer elements click event wont get triggered.
<div (click)="outerElementClicked()">
<div propagationStop (click)="innerElementClicked()"></div>
</div>
Thanks to
This project is based on a StackOverflow answer: https://stackoverflow.com/questions/35274028/stop-mouse-event-propagation-in-angular