Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

org.webjars.npm:github-com-NeverwinterMoon-angular-swipe

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

org.webjars.npm:github-com-NeverwinterMoon-angular-swipe

WebJar for angular-swipe

  • 0.4.0
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Simple vertical/horizontal swipe gesture directives and a swipe service for AngularJS

#angular-swipe

Should be used as a replacement for ngTouch and its ngSwipeLeft and ngSwipeRight directives. The problem with ngTouch is that it replaces all default ngClick directives and can screw up how focus event works in input fields which are wrapped with ngClick directive. More on the problem with ngTouch here: https://github.com/angular/angular.js/issues/6432#issuecomment-54636616.

Install

  • This is intended to be used as npm module only and works really well with browserify.
npm install angular-swipe --save-dev
  • Require the angular-swipe module
import swipe from 'angular-swipe'
  • Add dependency to the angular-swipe ng module
angular.module('app', [ swipe.name ]);

Usage

Directives
  • ng-swipe-up
  • ng-swipe-down
  • ng-swipe-left
  • ng-swipe-right
Directive attributes

ng-swipe-disable-mouse "This attribute is useful for text that should still be selectable by the mouse and not trigger the swipe action."

Service
  • swipe

Example

<div class="page" ng-controller="AppController">
    <div class="container" ng-swipe-up="swipe($event)">
      <h1>Swipe me up!</h1>
    </div>
</div>
import { module, bootstrap } from 'angular';
import swipe from 'angular-swipe';
module('app', [ swipe.name ])
    .controller('AppController', $scope => {
      $scope.swipe = $event => console.log($event);
    })

Known issues and workarounds

  • ng-swipe-up and ng-swipe-down uses preventDefault when you start swiping. This prevents clicks from giving focus to input fields. Adding a noPreventDefault class to these elements will not preventDefault when the swipe start on them and thus allow clicks to work.

FAQs

Package last updated on 07 Dec 2016

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc