JSPM

  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q72230F
  • License MIT

Stop Click Propagation on any Element.

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

Build Status Commitizen friendly

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 { PropagationStopDirective } from 'ngx-propagation-stop';

@NgModule({
  declarations: [
    PropagationStopDirective
  ]
})

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>

Contribute

This project is based on a StackOverflow answer: https://stackoverflow.com/questions/35274028/stop-mouse-event-propagation-in-angular