0.0.2 • Published 1 year ago

@awaismirza/angular2-counto v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@owaesmirza/angular2-counto

Angular 14+ package for nice count animations

Installation

npm i --save @awaismirza/angular2-counto

SystemJS

var map = {
  'angular2-counto':     'node_modules/angular2-counto/src'
};

var packages = {
  'angular2-counto':   { main: 'counto.module.js', defaultExtension: 'js' }
};

Angular-CLI

Just import module as below:

import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { CountoModule }  from 'angular2-counto';

@NgModule({
  imports:      [ BrowserModule, CountoModule ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})
export class AppModule { }

Example with currency pipe:

<div counto [step]="30" [countTo]="10" [countFrom]="0" [duration]="4" (countoChange)="counto = $event" (countoEnd)="onCountoEnd()">{{counto | currency:'EUR':'symbol':'1.2-2'}}</div>

Usage

ParameterRequiredUnitDescription
stepyesmilisecondHow fast counter is updated
countToyesnumberAny start number
countFromyesnumberAny end number
durationyessecondsDuration of animation

Any of above parameters can be freely binded to an event. Every time parameter changes, animation will be executed. You can use any pipe you want to modify output to your needs.

Demo

http://izupet.github.io/angular2-counto

0.0.2

1 year ago

0.0.1

1 year ago