Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ngx-propagation-stop

DanielHabenicht106MIT2.0.29TypeScript support: included

Stop Click Propagation on any Element.

angular, propagation

readme

npm version Build Status Commitizen friendly Renovate enabled codecov FOSSA Status

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

License

FOSSA Status