0.0.3 • Published 7 years ago

angular-count-to v0.0.3

Weekly downloads
1,315
License
MIT
Repository
github
Last release
7 years ago

angular-count-to

A simple count-to directive that counts from a number to a number.

Requirements

  • Angular >= 4.0.0

Installation

npm install angular-count-to --save

In your app.module.ts:

import { CountToModule } from 'angular-count-to';
@NgModule({
    ...
    imports: [CountToModule]
    ...
});

Background

Example

// Controller
count = {
    countTo: 100,
    from: 0,
    duration: 1
};

// Template
<span [CountTo]="count.countTo" [from]="count.from" [duration]="count.duration"></span>

// Write directly to the directive
<span CountTo="100" from="0" duration="10"></span>
ValueRequiredDefaults to
CountToyesN/a
fromno0
durationno4

TODOS

  • Write test scripts

License

MIT