You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
"minValidator" does not make sense as a formatter. Input number "min" does not show initial value when it is invalid #8264
You are displaying a Form intending to show fields with proper validation e.g. min=10 for .
The model returns a number 3 as what was probably saved prior say in some database. Or your business rules have changed and the min value now must be 10 but it was say min=2 in the previous release of your application.
Possible diagnosis
e.g.
minValidator
if (attr.min) {
var minValidator = function(value) {
var min = parseFloat(attr.min);
return validate(ctrl, 'min', ctrl.$isEmpty(value) || value >= min, value);
};
ctrl.$parsers.push(minValidator);
ctrl.$formatters.push(minValidator); //I wonder if you really need this
///all you need is a number validator
}
Activity
caitp commentedon Jul 18, 2014
The fact is, none of the validation really belongs in parsers or formatters. Validation and parsing/formatting are really separate operations.
Anyhow, this is being worked on, thanks for sharing the pain of the current validation stuff =)
IgorMinar commentedon Jul 21, 2014
@matsko can you add this as a test case to your refactoring branch and close this issue please?
IgorMinar commentedon Jul 21, 2014
@yogeshgadge fyi, please watch #6928
Narretz commentedon Sep 5, 2014
This is fixed in master: http://jsfiddle.net/PK3QH/24/
This is won't fix in 1.2.x afaik, because validation via parsers is too rigid.