ngx-countto
Angular 2+ component that counts up to a specified number. And accompanying service to trigger the action at a desired time or event. Supports multiple instances and different starting times.
Installation
To install this library, run:
$ npm install ngx-countto --save
Usage
Add the component in your Angular application's template:
<!-- You can now use your library component in app.component.html -->{{title}}
And in your Angular AppModule
, import the library then trigger the counting by calling CountToService
's function start()
anywhere from your application logic:
;;; // Import the library;
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
id | string | countto |
Element ID of the component. For multi-component support |
from | number | 0 |
Starting number (Not yet supported) |
to | number | from + 10 |
Ending number |
duration | number | ? |
Duration (Not yet supported) |
Examples
License
MIT © Kris Nyunt