Security News
New Proposed CISA Mandate Would Require Critical Infrastructure to Report Ransom Payments Within 24 Hours
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
ngx-long-press2
Advanced tools
Angular Library to handle long mouse clicks event for desktop and long touch events for mobile and tablets
Weekly downloads
Readme
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:
View all the directives and components in action at https://anthonynahass.github.io/ngx-long-press2
ngxLongPress2
10.x
Install peer dependencies
npm i -s ngx-long-press2
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:
option | bind | type | default | description |
---|---|---|---|---|
minTime | Input() | number | 500 | the minimum time to fire onLongPress event (in ms) |
maxTime | Input() | number | 2000 | the maximum time to fire onReleasePressing event (in ms) |
onLongPress | Output() | EventEmitter<void> | - | emits when the minTime is exceeded |
onLongPressing | Output() | EventEmitter<number> | - | emits when the user is pressing and the time lapsed in ms will be emitted |
onReleasePressing | Output() | EventEmitter<void> | - | emits when the maxTime is exceeded or touchend, mouseup and mouseleave haven been emitted |
<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>
<button ngxLongPress2></button>
images
Build the library
$ npm run build:lib
Serve the demo app
$ npm start
Built by and for developers :heart: we will help you :punch:
This project is supported by jetbrains with 1 ALL PRODUCTS PACK OS LICENSE incl. webstorm
Copyright (c) 2020 Anthony Nahas. Licensed under the MIT License (MIT)
FAQs
Angular Library to handle long mouse clicks event for desktop and long touch events for mobile and tablets
The npm package ngx-long-press2 receives a total of 201 weekly downloads. As such, ngx-long-press2 popularity was classified as not popular.
We found that ngx-long-press2 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
CISA has proposed a set of new rules that would require critical infrastructure to report cyber incidents and ransom payments.
Security News
Redis is no longer OSS, breaking its explicit commitment to remain under the BSD 3-Clause License forever. This has angered contributors who are now working to fork the software.
Product
Socket AI now enables 'AI detected potential malware' alerts by default, ensuring users benefit from AI-powered state-of-the-art malware detection without needing to opt-in.