0.0.4 • Published 2 years ago
ang-click-outside v0.0.4
ang-click-outside
Angular directive to detect a click outside of one element.
Demo
- WIP
Table of Contents
Installation
npm i ang-click-outside
Usage
import AngClickOutsideModule
in your Module
import { AngClickOutsideModule } from 'ang-click-outside';
@NgModule({
...
imports: [
...
AngClickOutsideModule,
],
...
})
export class YourModule {}
Example
<div
(angClickOutside)="onClickOfOutside()"
[angClickOutsideState]="enableClickOutside"
></div>
export class YourComponent {
enableClickOutside: boolean = true;
onClickOfOutside(mouseEvent: MouseEvent) {
console.log('clicked outside: ', mouseEvent);
}
}
Props
Name | Type | Required | Default | Description |
---|---|---|---|---|
angClickOutsideState | boolean | No | true | Used to enable or disable outside click event. |
Events
Name | Returns | Description |
---|---|---|
angClickOutside | MouseEvent | This event will call if clicked outside. |
Contributing
- Fork it ( https://github.com/aniket-kale/ang-click-outside/fork )
- Create your feature branch (
git checkout -b feat/new-feature
) - Commit your changes (
git commit -m 'feat: add feature'
) - Push to the branch (
git push origin feat/new-feature
) - Create a new Pull Request
Note:
- Please contribute using Github Flow
Author
ang-click-outside © Aniket