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

Model value type question #7

Open
Dmitry44 opened this issue Oct 23, 2014 · 2 comments
Open

Model value type question #7

Dmitry44 opened this issue Oct 23, 2014 · 2 comments

Comments

@Dmitry44
Copy link

Hi!
I found your component is very useful - thank you!
What I didn't understand is why model's type is changing.
For example: I have $scope.amount = 1234.00 but if I try to change the amount I will have new value of the $scope.amount as a string. I think model's value type should be the same.
http://plnkr.co/edit/VaA7gXG6yBeuOC2WaT0W?p=preview

@simonsheridan
Copy link

the has to be type="text" so it makes sense it would be a string

@dougsatch
Copy link

I had the same issue. I changed the ngModelCtrl.$parsers.unshift method to return parseFloat(noCommasVal), and that seems to work. Would it be possible to make it an option e.g. {returnNumber: true} ?

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

3 participants