Hi,
So some of my matchingElementDifferential have min=1 and a max=1
what I am doing below kind of only seems to work for min=1?!
if (matchingElementDifferential.min > 0 || matchingElementDifferential.max
> 0) {
console.log('validatorsa: ',matchingElementDifferential.min);
console.log('validatorsb: ',matchingElementDifferential.max);
validators.push(
Validators.required,
Validators.requiredTrue,
Validators.minLength(matchingElementDifferential.min),
Validators.maxLength(matchingElementDifferential.max)
);
}
else if (matchingElementDifferential.min > 0) {
console.log('validatorsc: ',matchingElementDifferential.min);
validators.push(
Validators.required,
Validators.minLength(matchingElementDifferential.min)
);
}
else if (matchingElementDifferential.max) {
validators.push(
Validators.required,
Validators.maxLength(matchingElementDifferential.max)
);
}
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/33bfb2ca-5f7f-43ac-967d-d927376bfc59n%40googlegroups.com.