How do I programmatically call resolve(event)?
See original GitHub issueI followed the guide on the front page for the invisible captcha.
I have referenced captcha in my .ts file
@ViewChild('captchaRef') public captcha: RecaptchaComponent;
and in my html I got this
<re-captcha #captchaRef="reCaptcha" size="invisible" siteKey="super-secret-key" (resolved)="resolved($event)"></re-captcha>
I am calling this.captcha.execute()
to trigger execution but how do I call resolved(event)? When I try to assign this.captcha.resolved I get an EventEmitter. I am still pretty new to Angular so not sure what to do with that information. I tried using this.captcha.resolved.emit(); but what am I supposed to emit?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How can I programmatically invoke an onclick() event from a ...
To trigger an event you basically just call the event handler for that element. Slight change from your code.
Read more >Creating and triggering events - MDN Web Docs - Mozilla
This article demonstrates how to create and dispatch DOM events. Such events are commonly called synthetic events, as opposed to the events ......
Read more >Raising/Calling a Control Event of Another Web Form ...
This article shows how to call a control click event of another web form programmatically.
Read more >How to programmatically fire a click event for a file input ...
Approach: Whenever you want to perform a click event programmatically, at your specific condition, just use JavaScript in-built click() function ...
Read more >Invisible reCAPTCHA - Google Developers
Programmatically invoke the challenge. Configuration. JavaScript resource (api.js) parameters; g-recaptcha tag attributes and ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Starring this repo is enough of a tip for me 😃
Thanks a lot. You provided me with a lot of food for thought above and beyond! It wasn’t my intention to steer the discussion outside of library scope. At the end of the day, I was just wondering if there is any way to call
(click)="captchaRef.execute()"
except inside .ts file and not html file?this.captcha.execute()
seems to do nothing 😛Otherwise, your solution seems to have worked. I used captcha way too many times so it asks me to fill images, but I assume if it wasn’t asking then it would simply emit the value straight away.
P.S. Anyway I could perhaps give you a small tip for your trouble? you’ve been a great help!