Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find name 'grecaptcha'

I've a form in angular 2 application. Once the user submits the form, if some thing wrong in the user input then I'm showing validation messages. Now the problem is I need to reset the reCAPTCHA widget. I can do that using grecaptcha.reset(). It is working fine.

disableSubmitButton(value) {
    grecaptcha.reset();
    this.isSubmitButtonEnabled = value; 
}

But in typescript file I'm getting a compiler Cannot find name 'grecaptcha' which is causing a build error.

How can I resolve this issue.

like image 891
dinesh sharaf Avatar asked Apr 25 '26 10:04

dinesh sharaf


1 Answers

Just encountered the same problem.

This package has the definition for grecaptcha

npm install --save @types/grecaptcha
like image 50
Sasan Avatar answered Apr 27 '26 04:04

Sasan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!