Skip to content

Commit 1024fd4

Browse files
author
Rumit Parakhiya
authored
Fix: Call to reset() method fails when form contains radio buttons
Checked existence of the property in `scope[formElement.Name]` too, before calling `$setViewValue("")` on it
1 parent 9b1b176 commit 1024fd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/angular-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ angular.module('angularValidator').directive('angularValidator', ['$injector', '
8282
// Clear all the form values. Set everything to pristine.
8383
scopeForm.reset = function() {
8484
angular.forEach(DOMForm, function(formElement) {
85-
if (formElement.name) {
85+
if (formElement.name && scopeForm[formElement.name]) {
8686
scopeForm[formElement.name].$setViewValue("");
8787
scopeForm[formElement.name].$render();
8888
}

0 commit comments

Comments
 (0)