# ngx-intersect

> Angular wrapper of [IntersectionObservable](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) API.

Latest version **0.0.3** (published 2018-11-22) · 0 weekly downloads

## Install

```sh
npm install ngx-intersect
pnpm add ngx-intersect
yarn add ngx-intersect
bun add ngx-intersect
```

## 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.3 |
| Published | 2018-11-22 |
| First published | 2018-11-22 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 96.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | surge83 |

## Links

- npm: https://www.npmjs.com/package/ngx-intersect
- npm.io page: https://npm.io/package/ngx-intersect

## Dependencies (1)

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

## Recent versions

- 0.0.3 (latest) — 2018-11-22
- 0.0.2 — 2018-11-22
- 0.0.1 — 2018-11-22

## README

# NgxIntersect

Angular wrapper of [IntersectionObservable](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry) API.  

## Installation

Using npm:
```shell
npm i ngx-intersect
```
## Usage

 Import `NgxIntersectModule` into your module. 


Use `ngxIntersect` directive to get enter/exit viewport events. 
```html
  <div class="box" 
         ngxIntersect
         (intersectionChanged)="updateThreshold($event, 'box1')"
         (withinViewChanged)="log($event, 'box1')">
         ... My Content
  </div>
```

Use  `@Input() threshold` and `@Input() rootMargin` to configure intersection thresholds. 

Use `ngxIntersectAnchor` to anchor ancestor element as viewport. 
```html
  <div class="container" ngxIntersectAnchor>
    <div class="box" 
           ngxIntersect
           (intersectionChanged)="updateThreshold($event, 'box1')"
           (withinViewChanged)="log($event, 'box1')">
           ... My Content
    </div>
  </div> 
```



## TODO: 
- [ ] demo site  
- [ ] jest (ngrx store example)
- [ ] circle 
- [ ] changelog https://github.com/conventional-changelog/conventional-changelog

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