11.0.2 • Published 2 years ago

@baycke/ngx-counter v11.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ngx-counter

Version compatibility

Install later versions in case your app is not running the very latest angular version.

ngx-counter/ngx-counter versioncompatible angular versionDocumentation
v11.xv12, v11, v10, v9, v8README

Directive

For ease of use a directive ngxCounter.

Setup

First you need to install the core npm module:

npm install @baycke/ngx-counter --save

Then add the NgxCounterModule to the imports array of your application module:

import { NgxCounterModule } from '@baycke/ngx-counter';

@NgModule({
    imports: [
        /* Other imports here */
        NgxCounterModule
        ]
})
export class AppModule {
}

Usage

@Component({
   ...
   template: `...
        <div ngxCounter [end]="counterNumber" [countSpeed]="6000" [countInterval]="10" (counterValue)="getValue($event)">
            <h3>{{counterTestValue}}</h3>
        </div>
   ...`,
})
export class MyComponent {
}

Directive API

Additional attributes may be set on an DOM element using the ngxCounter directive for customization.

NgxCounter properties

AttributeTypeDefaultDescription
ngxCounterAttribute adding counter
endnumber
counterSpeednumber5000Speed in millisecond the animation should take.
counterIntervalnumber20couter interval

NgxCounter events

EventTypeDescription
counterValuenumber