ngx-outside-click
v1.0.2
Published
Simple Angular module to detect a click outside of one element.
Downloads
406
Readme
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).