# ngx-in-viewport

> [![npm version](https://badge.fury.io/js/ngx-in-viewport.svg)](https://badge.fury.io/js/ngx-in-viewport)

Latest version **0.0.2** (published 2018-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-in-viewport
pnpm add ngx-in-viewport
yarn add ngx-in-viewport
bun add ngx-in-viewport
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-03-13 |
| First published | 2018-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 29.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Cory Rylan |
| Maintainers | splintercode |

## Links

- npm: https://www.npmjs.com/package/ngx-in-viewport
- Repository: https://github.com/coryrylan/ngx-in-viewport
- Homepage: https://github.com/coryrylan/ngx-in-viewport#readme
- Issues: https://github.com/coryrylan/ngx-in-viewport/issues
- npm.io page: https://npm.io/package/ngx-in-viewport

## Dependencies (1)

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

## Recent versions

- 0.0.2 (latest) — 2018-03-13
- 0.0.1 — 2018-03-11
- 0.0.0 — 2018-03-04

## README

# ngx-in-viewport

[![npm version](https://badge.fury.io/js/ngx-in-viewport.svg)](https://badge.fury.io/js/ngx-in-viewport)

A simple Angular Directive to easily determine if a element in in the viewport.

## [Demo](https://stackblitz.com/edit/angular-ecokut)

## Installation

To install this library, run:

`npm install ngx-in-viewport --save`

and then from your Angular `AppModule`:

```typescript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxInViewportModule } from 'ngx-in-viewport';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxInViewportModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

```

## Component

Once the library is imported, you can use the `ngx-debounce-click` directive.

```typescript
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';

@Component({
  selector: 'app-root',
  template: `
  <div ngxInViewport (inViewport)="log($event)">
    Hello World!
  </div>
  `
})
export class AppComponent {
  log(event) {
    console.log(event);
  }
}
```

## License

MIT © [Cory Rylan](https://coryrylan.com)

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