Skip to content
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

valueText="0" is treated as falsy #35

Open
doug-a-brunner opened this issue May 21, 2020 · 0 comments
Open

valueText="0" is treated as falsy #35

doug-a-brunner opened this issue May 21, 2020 · 0 comments

Comments

@doug-a-brunner
Copy link

It seems that if, using the JS API (options object), you set valueText to anything that can be parsed as a number, it will be parsed as such and treated as falsy by the underlying canvas-gauges. This can result in some confusing glitches. I found that canvas-gauges on its own suffers from the same problem, but only if you use its HTML attribute API (data-value-text="0" appears falsy, which is really a limitation of the API's design). If you provide it an option object with valueText: "0", it is correctly treated as truthy and rendered.

ng-canvas-gauges should provide its values to canvas-gauges using the JS API to avoid this problem.

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

No branches or pull requests

1 participant