ngx-ionic-long-press
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

ngx-long-press

About

A IONIC gesture feature, for long press events

Instalation

 npm i ngx-long-press --save

Usage

app.module.ts

import { NgxLongPressModule } from 'ngx-long-press';

@NgModule({
  imports: [
    NgxLongPressModule
  ]
})
export class AppModule {}

add the directive [long-press] and the event callback (didLongPress) to the element you want to listen.

if you want a diferent duration for the press, pass the value as miliseconds on [presss-duration], default = 1500

app.component.html

    <ion-toolbar>
        <ion-title size="large" [long-press] (didLongPress)="alertLongPress()">Blank</ion-title>
    </ion-toolbar>

app.component.ts

export class AppComponent {
  constructor() {}
  public alertLongPress(){
      console.log("user did long press for 1500 ms")
  }
}

Properties

Name Description Type default
(didLongPress) Emitted when a long-press is capturated. ()=>Void
[presss-duration] Minimal duration for the press to count number default = 1500

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.12latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.12

Package Sidebar

Install

npm i ngx-ionic-long-press

Weekly Downloads

2

Version

0.0.1

License

Apache 2.0

Unpacked Size

36.2 kB

Total Files

17

Last publish

Collaborators

  • carlosbenedetti