Here, if I input more than 10 characters it validates the ng-maxlength validation but then further if I increases the characters it gets overrides with the ng-pattern validation.
Ok Thanks @johannesjo for the explanation. But how can we avoid this to work as required. Can you give some suggestion to solve this issue of number getting converted into decimals.
I have a input[number] field with ng-maxlength and ng-pattern set on it. The input structure is as follows: `
Here, if I input more than 10 characters it validates the ng-maxlength validation but then further if I increases the characters it gets overrides with the ng-pattern validation.
Please help
The problem being most likely that the number input is still buggy in multiple browsers. Thanks for reporting though. I will look into this.
Check out this plunkr: http://plnkr.co/edit/NQzCas?p=preview When you assign the value from the controller:
It gets converted to 1.2345678901234568e+21
That might be why the max-length acts weird at some point (and so does the pattern check).
I don't have a indepth explanation, but would be happy to understand it better.
Ok Thanks @johannesjo for the explanation. But how can we avoid this to work as required. Can you give some suggestion to solve this issue of number getting converted into decimals.
You have 3 options:
If you're still unsure, I recommend going to Stackoverflow. Your problem is really beyond the scope of this repo.
Thanks for the suggestions :+1:
You're welcome!