question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I programmatically call resolve(event)?

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DethArielcommented, Mar 24, 2017

Starring this repo is enough of a tip for me 😃

0reactions
Nikki1993commented, Mar 24, 2017

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found