-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormControl.errorsSubject is undefined when using asyncValidator #91
Comments
Can you please reproduce on stackblitz? |
Will do. |
FYI: I encountered the same issue @NetanelBasal. Note that even if an error is thrown, it's not breaking the app, so it's just annoying, nothing else. The error is thrown from this source: setErrors(errors, opts = {}) {
this.errorsSubject.next(errors);
return super.setErrors(errors, opts);
} The |
Can you please reproduce on stackblitz? |
I added it to codesandbox which I found way better and I have the same issue. |
Actually, since your custom control is using the super from the extended Angular class, the latest will call the |
Tested and I can confirm it's good. |
I'm submitting a...
Current behavior
When instantiating a FormGroup with asyncValidators an error occurs.
ERROR TypeError: Cannot read property 'next' of undefined at FormControl.setErrors (ngneat-reactive-forms.js:368) at SafeSubscriber._next (forms.js:3241) at SafeSubscriber.__tryOrUnsub (Subscriber.js:183) at SafeSubscriber.next (Subscriber.js:122) at Subscriber._next (Subscriber.js:72) at Subscriber.next (Subscriber.js:49) at Observable._subscribe (subscribeToArray.js:3) at Observable._trySubscribe (Observable.js:42) at Observable.subscribe (Observable.js:28) at FormControl._runAsyncValidator (forms.js:3236)
Expected behavior
Should work. Does so when using default angular FormBuilder.
Minimal reproduction of the problem with instructions
Created a form group with some sync and some async validators (which are fetching stuff from the API)
Environment
The text was updated successfully, but these errors were encountered: