AngularJS directive for countUp
A simple Angularjs directive for countUp.js.
see https://github.com/inorganik/countUp.js
- Make sure the CountUp.js is loaded.
- Include the
angular-countUp.js
script into your app. - Add
countUp
as a module dependency to your app.
Put the countup
tag into your html.
<countup startval="countup.startval"
endval="countup.endval"
duration="3"
decimals="0"
options="countup.options">
</countup>
angular.module('myApp', ['countUp']).controller('myCtrl', function($scope) {
$scope.countup = {
startval: 100,
endval: 0,
// default options
options: {
useEasing : true,
useGrouping : true,
separator : ',',
decimal : '.'
}
};
});