Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit bc59bba

Browse files
committed
fix(formlyValidationMessages): handle falsy values in templateOptions validation attributes properly
This should fix setting {min: 0} in field templateOptions to return proper message
1 parent 559fddb commit bc59bba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/providers/formlyValidationMessages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function formlyValidationMessages() {
2323

2424
function templateOptionValue(prop, prefix, suffix, alternate) {
2525
return function getValidationMessage(viewValue, modelValue, scope) {
26-
if (scope.options.templateOptions[prop]) {
26+
if (typeof scope.options.templateOptions[prop] !== 'undefined') {
2727
return `${prefix} ${scope.options.templateOptions[prop]} ${suffix}`
2828
} else {
2929
return alternate

0 commit comments

Comments
 (0)