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 >= "

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top