diff --git a/src/angular-validator.js b/src/angular-validator.js index 6445d85..f2cdf32 100644 --- a/src/angular-validator.js +++ b/src/angular-validator.js @@ -82,7 +82,7 @@ angular.module('angularValidator').directive('angularValidator', ['$injector', ' // Clear all the form values. Set everything to pristine. scopeForm.reset = function() { angular.forEach(DOMForm, function(formElement) { - if (formElement.name) { + if (formElement.name && scopeForm[formElement.name]) { scopeForm[formElement.name].$setViewValue(""); scopeForm[formElement.name].$render(); }