Socket
Socket
Sign inDemoInstall

ng-swipe

Package Overview
Dependencies
5
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ng-swipe

## Installation


Version published
Maintainers
1
Created

Readme

Source

Angular Swipe

Installation

npm install ng-swipe --save

Usage

Import SwipeModule to your module:

import { SwipeModule } from 'ng-swipe';

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

Add ngSwipe directive to your DOM element and listen to swipeMove or swipeEnd events that are emitted when swipe happens on this element.

import { SwipeEvent } from 'ng-swipe';

@Component({
  selector: 'app',
  template: `
    <div 
      ngSwipe 
      (swipeMove)="onSwipeMove($event)" 
      (swipeMove)="onSwipeEnd($event)"
    >My test element for swipe</div>
  `
})
export class AppComponent {
  onSwipeMove(event: SwipeEvent) {
    console.log(`swipe direction: ${event.direction}`);
    console.log(`swipe distance: ${event.distance}`);
  }
  onSwipeEnd(event: SwipeEvent) {
    console.log(`swipe direction: ${event.direction}`);
    console.log(`swipe distance: ${event.distance}`);
  }  
}

FAQs

Last updated on 31 Jul 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc