Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Added from_zero option #114

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Added from_zero option #114

wants to merge 4 commits into from

Conversation

maxflex
Copy link

@maxflex maxflex commented Feb 9, 2016

Added from_zero option, so the animation starts from zero.

Usage:

window.odometerOptions =
  from_zero: true

@zackbloom
Copy link
Contributor

Why not just initialize the content of the thing being odometered with the value 0?

@maxflex
Copy link
Author

maxflex commented Feb 9, 2016

@zackbloom because when using, for example, Vue.js like I do, or AngularJS, or any of the other modern framework, you usually do stuff like this:

<span class='odometer'>{{ post.likes }}</span>

That way it would show the animation immediately with no other actions required framework-wise.
And it just feels like this option should be there, seems like such a common thing.

@zackbloom
Copy link
Contributor

Makes sense. All the other options are camel case, so it should be fromZero. You might want to consider generalizing it to be just a from option which can be set to any number though (including 0).

Usage:
```
window.odometerOptions =
  from: 0 # number to start animation from
```
@maxflex
Copy link
Author

maxflex commented Feb 10, 2016

@zackbloom done

@alkul93
Copy link

alkul93 commented Feb 26, 2016

Needed this option too, please merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants