You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ((formGroupValue.idade * formGroupValue.multiplo) === formGroupValue.besta) {
return null;
} else {
return { 'custom': { isValid: false, message: 'The beast value is not valid' } };
}
}
],
additionalValue: null
}))`
However, when modifying the input to beast, its value is read within my condition, always a previous state.
If I enter 1, it remains at 0, which is its initial state. If I type 10, it changes to 1. If I type 100, it changes to 10. And so on.
Why does it happen? Is it a library error or am I not handling my object correctly?
I thought that in this case I should work with asynchronicity, but when changing to customAsync this.entidadeForm.get('beast')?.addAsyncValidators(RxwebValidators.customAsync(...) I get the error APP_VALIDATORS[validatorName] is not a function
Package version
@rxweb/reactive-form-validators 13.0.1
The text was updated successfully, but these errors were encountered:
Help with RxwebValidators.custom and RxwebValidators.customAsync
Hello, I need help with the RxwebValidators.custom and RxwebValidators.customAsync method in Angular
I'm doing some tests to understand how the library works.
I created my form with three attributes:
this.entidadeForm = this.formBuilder.group({ age: [0, [RxwebValidators.required({ message: 'Required field' }), RxwebValidators.minNumber({ value: 10, message: 'Minimum of 10' })]], multiple: [0], beast: [0, []] });
For my test I need the beast field to be equal to age * multiple
` this.entidadeForm.get('beast')?.addValidators(RxwebValidators.custom({
customRules: [(formGroupValue: any, parentObject: any, additionalValue: any) => {
However, when modifying the input to beast, its value is read within my condition, always a previous state.
If I enter 1, it remains at 0, which is its initial state. If I type 10, it changes to 1. If I type 100, it changes to 10. And so on.
Why does it happen? Is it a library error or am I not handling my object correctly?
I thought that in this case I should work with asynchronicity, but when changing to customAsync this.entidadeForm.get('beast')?.addAsyncValidators(RxwebValidators.customAsync(...) I get the error APP_VALIDATORS[validatorName] is not a function
Package version
@rxweb/reactive-form-validators 13.0.1
The text was updated successfully, but these errors were encountered: