# ng-event-outside

Latest version **1.0.0** (published 2018-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install ng-event-outside
pnpm add ng-event-outside
yarn add ng-event-outside
bun add ng-event-outside
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-08-26 |
| First published | 2018-08-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 92.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Yair Tawil |
| Maintainers | yairtawil |

## Links

- npm: https://www.npmjs.com/package/ng-event-outside
- Repository: https://github.com/yairtawil/ng-event-outside
- Homepage: https://github.com/yairtawil/ng-event-outside#readme
- Issues: https://github.com/yairtawil/ng-event-outside/issues
- npm.io page: https://npm.io/package/ng-event-outside

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Recent versions

- 1.0.0 (latest) — 2018-08-26

## README

# ng-event-outside

[![NPM](https://nodei.co/npm/ng-event-outside.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/ng-event-outside/)

**[Demo](https://yairtawil.github.io/ng-event-outside/)**


## Installation

```shell
npm install ng-event-outside
```

## Usage

Add `NgEventOutsideModule` to your list of module imports:

```typescript
import { NgEventOutsideModule } from 'ng-event-outside';

@NgModule({
  imports: [
    ...
    NgEventOutsideModule
],
...
})
export class AppModule { }

```
Use the `ngEventOutside` directive in your html templates:

```html
  <button (click)="toggleShow()"> Show <button>
  <div ngIf="*show" (ngEventOutside)="onEventOutside($event)"></div>
```

```typescript
export class AppComponent {
  toggleShow() {
    this.show = !this.show;
  }
  
  onEventOutside($event) {
    this.show = false;
  }
}
```

### Outputs
name | description
--- | --- 
```(ngEventOutside)``` | This event fires when `[eventListener]` invoked outside.     

### Inputs
Name | Type | Default | Description
--- | --- | --- | ---
`[excludes]` | ```HTMLElement[]``` | ```[]``` | An array of excluded elements.  
`[eventListener]` | ```string``` | 'click' | A String that specifies the name of the HTML DOM event.

---
_Source: https://npm.io/package/ng-event-outside · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
