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
It seems that it is just validating the inputs rendered at the very first and if that input is no longer in the DOM, because the ng-if condition is changed to false by the user interaction, it throw the exception when trying to $setValidity in an element that is not in the DOM. Has anyone had this issue before? Any help will be really appreciated!!
Thank you.
The text was updated successfully, but these errors were encountered:
Although ngIf removes the element from the DOM, as well as the related property from the form object, angularValidator still finds the DOM element somehow thus tries to retrieve and validate the property in the form object. As the property is already removed from the form object it will throw an undefined error. There is a condition in the source code which checks if the given DOM element has a validator property and if so it triggers the process. My solution is based on that condition, if we remove the validator property the condition will evaluate to false and nothing will be triggered. This is not the best solution, but can be a quick fix as this repo seems pretty abandoned. Maybe in the future I'll fork it and resolve the issue in the source code - if so I'll link it here.
Hello guys,
I'm getting this error "Cannot read property '$setValidity' of undefined". Am I missing something? Below is my code:
It seems that it is just validating the inputs rendered at the very first and if that input is no longer in the DOM, because the ng-if condition is changed to false by the user interaction, it throw the exception when trying to $setValidity in an element that is not in the DOM. Has anyone had this issue before? Any help will be really appreciated!!
Thank you.
The text was updated successfully, but these errors were encountered: