Package Exports
- ngx-propagation-stop
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngx-propagation-stop) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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