# angular-scroll-spy

> broadcast an event when an element comes into or goes out of view

Latest version **1.0.0** (published 2016-01-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install angular-scroll-spy
pnpm add angular-scroll-spy
yarn add angular-scroll-spy
bun add angular-scroll-spy
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-01-08 |
| First published | 2016-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | @inorganik |
| Maintainers | inorganik |
| Keywords | angular, scrollspy |

## Links

- npm: https://www.npmjs.com/package/angular-scroll-spy
- Repository: https://github.com/inorganik/angular-scroll-spy
- Homepage: http://inorganik.github.io/angular-scroll-spy/
- Issues: https://github.com/inorganik/angular-scroll-spy/issues
- npm.io page: https://npm.io/package/angular-scroll-spy

## Alternatives

- [pagerjs](https://npm.io/package/pagerjs.md) — 60 weekly downloads
- [whistle.savefor-mock](https://npm.io/package/whistle.savefor-mock.md) — 4 weekly downloads
- [@anil-labs/factory](https://npm.io/package/@anil-labs/factory.md) — 0 weekly downloads
- [@massiv-oss/grpc-fake-server](https://npm.io/package/@massiv-oss/grpc-fake-server.md) — 0 weekly downloads
- [@buoy-gg/location](https://npm.io/package/@buoy-gg/location.md) — 0 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-01-08

## README

# angular-scroll-spy

A simple, lightweight scroll-spy directive for angular that was built from scratch. It broadcasts events as elements are scrolled into or out of view.

### [Try the demo](http://inorganik.github.io/angular-scroll-spy/)

## Usage

Add the `scroll-spy` attribute and an `id` on the element you want to receive a scroll event for. 

- `'elementFirstScrolledIntoView'` is fired once when the element first scrolls into view
- `'elementScrolledIntoView'` is fired every time the element scrolls into view
- `'elementScrolledOutOfView'` is fired every time the element is scrolled out of view

Then in your controller, you can respond to events like this:

```js
$scope.$on('elementFirstScrolledIntoView', function (event, data) {
  if (data === 'myElementId') {
    // do something
  }
});
```

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