I'm developing Angular 2 + TypeScript app.
I need to reset reCaptcha if form is invalid.
But in my typescript code when I write grecaptcha.reset();
, I get error: Can not resolve symbol 'grecaptcha'
How can I reset reCaptcha or resolve/declare grecaptcha
variable and where?
For Typescript, declare
grecaptcha
:This presumes that the reCAPTCHA api has been included,
Alternatively,
grecaptcha
can be typed as follows:ReCAPTCHA Interface
Example
The following code is an outline and does not show the server side ReCAPTCHA verification.
ReCAPTCHA Service
Component