1
breezejs中允許空字符串在所需屬性中的首選方式是什麼?如何讓breezejs驗證器允許空字符串
我發現this answer其中建議更換這樣要求的驗證:
Validator.required = function (context) {
var valFn = function (v, ctx) {
return v != null;
}
return new Validator("required", valFn, context);
};
// register the new validator so that metadata can find it.
Validator.registerFactory(Validator.required, "required");
這裏也提到一個allowEmptyStrings
標誌的地方。
這樣做的首選方法是什麼?
是更換必需的驗證工廠仍使全球空字符串的首選方法原來的技術? –