sparkalow / angular-count-to

Angular directive to animate counting to a number
MIT License
150 stars 95 forks source link

Angular Count-To

This project is an animated counter for Angularjs. The directive counts from one number to another over a configured duration. Demo

How to use angular count-to

Include the javascript file.

<script src="https://github.com/sparkalow/angular-count-to/raw/master/angular.count-to.min.js"></script>

Inject the count-to directive in your app.

var myApp = angular.module('myApp', ['countTo']);

Apply the directive to a dom element.

 <span count-to="{{countTo}}" value="{{countFrom}}" duration="4"></span>

Attributes

The following attributes can be set as numbers on the directive element.