ngx-presson
Angular 2+ directive that will increment (or decrement) a counter variable while your element is being pressed. Similar to Medium's claps.
Installation
To install this library, run:
$ npm install ngx-presson --save
Usage
Add the directive in any element of your Angular application's template:
<!-- You can now use your library directive in app.component.html -->{{title}}PressonCounter: {{counter}}
In your Angular AppModule
, import the library:
;;; // Import the library;
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
presson | number | null |
Counter value |
pressonSpeed | number | 100 |
Counting speed in milliseconds |
pressonWait | number | 0 |
Delay in ms before counting starts after the mouse press |
pressonChange | event | null |
Change event to implement if using 'presson' for multiple elements |
License
MIT © Kris Nyunt