I've just confirmed that it is a bug. It will be fixed in the next release 1.4.12 out in a few days, or you can pull the latest code from the Breeze.Js github repo where it has already been fixed.
breeze Validator formatTemplate bug
-
15-07-2023 - |
题
When context value, that is rendered to template, equals 0, value is not inserted to validation message.
I have custom validator:
breeze.Validator.min = function(context) {
var fn = function(val, ctx) { return min <= ctx.min; }
return new breeze.Validator('min', fn, context);
}
breeze.Validator.messageTemplates.min = "Insert value >= %min%";
for validator: breeze.Validator.min({min: 0})
and negative number I get error message "Insert value >= "
解决方案
不隶属于 StackOverflow