-
Notifications
You must be signed in to change notification settings - Fork 6
Added separator, decimal, useGrouping and useEasing options support #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
7b7451f
6df60f4
763a7cd
01d0d58
f9e968b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,14 @@ angular.module('ngCountup', []) | |
numDecimals = attrs.numDecimals | ||
if attrs.animationLength? and isFinite attrs.animationLength | ||
animationLength = attrs.animationLength | ||
if attrs.separator? | ||
opts.separator = attrs.separator; | ||
if attrs.decimal? | ||
opts.decimal = attrs.decimal; | ||
if attrs.useGrouping? | ||
opts.useGrouping = if attrs.useGrouping == 'true' then true else false | ||
if attrs.useEasing? | ||
opts.useEasing = if attrs.useEasing == 'true' then true else false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as previous comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice, i don't use CoffeScript so i'm learning with this module 😄 , i must modify this pull then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
newVal ?= 0 | ||
oldVal ?= 0 | ||
new CountUp(attrs.id, oldVal, newVal, numDecimals, animationLength, opts).start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just do
opts.useGrouping = if attrs.useGrouping == 'true'