# ng-swipe

> An Angular directive wrapper for a lightweight library to detect swipes on touchscreen devices.

Latest version **2.0.1** (published 2022-06-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install ng-swipe
pnpm add ng-swipe
yarn add ng-swipe
bun add ng-swipe
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2022-06-28 |
| First published | 2019-07-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 23.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexander Goncharuk |
| Maintainers | agoncharuks |
| Keywords | swipe, gesture, touch, angular, directive |

## Links

- npm: https://www.npmjs.com/package/ng-swipe
- Homepage: https://github.com/aGoncharuks/ag-swipe
- npm.io page: https://npm.io/package/ng-swipe

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0
- [ag-swipe-core](https://npm.io/package/ag-swipe-core.md) ^1.0.0

## Alternatives

- [adhdev](https://npm.io/package/adhdev.md) — 11.1K weekly downloads
- [react-slide-button](https://npm.io/package/react-slide-button.md) — 310 weekly downloads
- [better](https://npm.io/package/better.md) — 42 weekly downloads
- [react-native-swipe-image](https://npm.io/package/react-native-swipe-image.md) — 22 weekly downloads
- [nl.fokkezb.pulltorefresh](https://npm.io/package/nl.fokkezb.pulltorefresh.md) — 11 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2022-06-28
- 2.0.0 — 2022-06-23
- 1.0.5 — 2019-08-05
- 1.0.4 — 2019-08-04
- 1.0.3 — 2019-08-04
- 1.0.2 — 2019-07-31
- 1.0.1 — 2019-07-31
- 1.0.0 — 2019-07-21

## README

This library is an Angular directive wrapper around the vanilla JS swipe detection library `ag-swipe-core`.

For more details on the public interface of the library please see the [Github page](https://github.com/aGoncharuks/ag-swipe).

## Installation

```
npm install ng-swipe --save
```

## Usage

```typescript
import { SwipeModule } from 'ng-swipe';

@NgModule({
  imports: [
    SwipeModule
  ],
})
```

```typescript
import { SwipeEvent } from 'ng-swipe';

@Component({
  selector: 'app',
  template: `
    <div 
      ngSwipe 
      (swipeMove)="onSwipeMove($event)" 
      (swipeEnd)="onSwipeEnd($event)"
    >Swipe me!</div>
  `
})
export class AppComponent {
  onSwipeMove(event: SwipeEvent) {
    console.log(`SwipeMove direction: ${event.direction} and distance: ${event.distance}`);
  }
  onSwipeEnd(event: SwipeEvent) {
    console.log(`SwipeEnd direction: ${event.direction} and distance: ${event.distance}`);
  }
}
```

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