0.0.4 • Published 2 years ago

ang-click-outside v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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

NameTypeRequiredDefaultDescription
angClickOutsideStatebooleanNotrueUsed to enable or disable outside click event.

Events

NameReturnsDescription
angClickOutsideMouseEventThis event will call if clicked outside.

Contributing

  1. Fork it ( https://github.com/aniket-kale/ang-click-outside/fork )
  2. Create your feature branch (git checkout -b feat/new-feature)
  3. Commit your changes (git commit -m 'feat: add feature')
  4. Push to the branch (git push origin feat/new-feature)
  5. Create a new Pull Request

Note:

  1. Please contribute using Github Flow

Author

ang-click-outside © Aniket

0.0.4

2 years ago

0.0.3

2 years ago

0.0.1

2 years ago