Open spacebiscuit opened 7 years ago
I had the same issue. a temporary hack/workaround could do the job now until issue is fixed.
this.recaptchers = [{}]
null
or undefined
or ''
you should do this too :
this.recaptchers.splice(0,1); this.recaptchers.push({});
<div vc-recaptcha ng-model="$ctrl.myRecaptchaResponse" required></div>
you need to do this :
<div ng-repeat="recaptcher in $ctrl.recaptchers" vc-recaptcha ng-model="$ctrl.myRecaptchaResponse" required></div>
it must erase the previous recaptcha and put a brand new one there in blink of an eye. : )
You can inject the Recaptcha Service into your controller and reset it there. Typescript example:
module app {
[...]
this.$scope.contactForm.name = null;
this.$scope.contactForm.emailAddress = null;
this.$scope.contactForm.message = null;
this.$scope.contactForm.myRecaptchaResponse = null;
this.$scope.contactForm.$setPristine();
this.vcRecaptchaService.reload();
[...]
angular.module('app').controller('Controller', ['$scope', 'vcRecaptchaService']);
}
Once my form has been verified and I have processed the forms data, when complete I want to reset my form. I am doing this as follows:
This works except for the re-captcha input, how can I reset this?