šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

ng-swipe

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-swipe

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

2.0.1
latest
npm
Version published
Maintainers
1
Created
Source

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.

Installation

npm install ng-swipe --save

Usage

import { SwipeModule } from 'ng-swipe';

@NgModule({
  imports: [
    SwipeModule
  ],
})
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}`);
  }
}

Keywords

swipe

FAQs

Package last updated on 28 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts