/angular-lazy-count

Angular directive to animate counting to a number

Primary LanguageJavaScriptMIT LicenseMIT

Angular Lazy-Count

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 lazy-count

Include the javascript file.

<script src="angular.count-to.min.js"></script>

Inject the lazyCount directive in your app.

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

Apply the directive to a dom element.

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

Attributes

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

  • count-to the number to count to.
  • value the number to start counting from.
  • duration how long the count should take in seconds.
  • offset when element's offsetTop is this value, start counting.

Development

You can build up this project from source with below commands:

npm install
grunt