ngx-outside-click
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

ngx-outside-click

Simple Angular module to detect a click outside of one element.

See interactive demo here: https://kuroidoruido.github.io/ngx-outside-click/ Demo source code here: https://github.com/kuroidoruido/ngx-outside-click/tree/master/demo

Installation

npm install ngx-outside-click

Usage

Basic

Import NgxOutsideClickModule then

<div (ngxOutsideClick)="doSomething($event)">
    ...
</div>

$event will be the ClickEvent.

Disable the listening

Import NgxOutsideClickModule then

<div (ngxOutsideClick)="doSomething($event)" [ngxOutsideClickEnabled]="false">
    ...
</div>

This way you can enable/disable on need (think about performance issue when your app can have a lot of outside click but only some of them are useful at once).

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-outside-click

Weekly Downloads

99

Version

1.0.2

License

MIT

Unpacked Size

31 kB

Total Files

17

Last publish

Collaborators

  • kuroidoruido