🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

ngx-long-press2

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-long-press2

Angular Library to handle long mouse clicks event for desktop and long touch events for mobile and tablets

16.1.0
latest
Source
npm
Version published
Weekly downloads
414
64.94%
Maintainers
1
Weekly downloads
 
Created
Source

angular-material-extensions's logo

ngx-long-press2 - Angular Library to handle long mouse clicks event for desktop and long touch events for mobile and tablets

npm version npm demo docs: typedoc Join the chat at https://gitter.im/angular-material-extensions/Lobby

@angular-material-extensions/select-country demonstration

Built by and for developers :heart:

Do you have any question or suggestion ? Please do not hesitate to contact us! Alternatively, provide a PR | open an appropriate issue here

If you like this project, support angular-material-extensions by starring :star: and sharing it :loudspeaker:

Table of Contents

Demo

View all the directives and components in action at https://anthonynahass.github.io/ngx-long-press2

Library's directive

  • ngxLongPress2

Dependencies

  • Angular developed and tested with 16.x

Installation

Install via npm.

Install peer dependencies

npm i -s ngx-long-press2

Import the library

import { NgxLongPress2Module } from 'ngx-long-press2'; 

@NgModule({
  declarations: [AppComponent, ...],
  imports: [NgxLongPress2Module, ...],  
  bootstrap: [AppComponent]
})
export class AppModule {
}

Other modules in your application like for lazy loading import NgxLongPress2Module into your feature module:

API

optionbindtypedefaultdescription
minTimeInput()number500the minimum time to fire onLongPress event (in ms)
maxTimeInput()number2000the maximum time to fire onReleasePressing event (in ms)
onLongPressOutput()EventEmitter<void>-emits when the minTime is exceeded
onLongPressingOutput()EventEmitter<number>-emits when the user is pressing and the time lapsed in ms will be emitted
onReleasePressingOutput()EventEmitter<void>-emits when the maxTime is exceeded or touchend, mouseup and mouseleave haven been emitted

Usage

  <button mat-raised-button
          ngxLongPress2
          [color]="this.timeLapsed1 > 1000? 'primary' : 'warn'"
          (onLongPress)="onLongPress()"
          (onLongPressing)="onLongPressing($event)"
          (onReleasePressing)="onReleasePressing()">
  {{ this.timeLapsed1 > 0 ? this.timeLapsed1 + ' ms' : 'PRESS ME'}}
</button>

@angular-material-extensions/select-country demonstration

<button ngxLongPress2></button>

images

Run Demo App Locally after cloning the github project

Build the library

$ npm run build:lib

Serve the demo app

$ npm start

Other Angular Libraries

Support

Built by and for developers :heart: we will help you :punch:

Who is using ngx-long-press2? Awesome apps?

Are you missing your project or you app? PR me to publish it on the README

jetbrains logo

This project is supported by jetbrains with 1 ALL PRODUCTS PACK OS LICENSE incl. webstorm

License

Copyright (c) 2023 Anthony Nahas. Licensed under the MIT License (MIT)

angular-material-extensions's logo

Keywords

ng

FAQs

Package last updated on 04 Nov 2023

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