I have followed the instructions listed here, but still can't get the reCAPTCHA to render in the template. I can't get the automatic rendering nor the explicit rendering to work for me. Can anybody give me more specific instructions that are tailored towards ember.js so that I can get the reCAPTCHA to render? I suppose that you are suppose to make it into a component since it will be used on many forms throughout the site.
As always, any help would be appreciated, and if you need any further details, I would be more than happy to provide them.
I used to put the Google nocaptcha recaptcha script tag in the index.html and setup a component that only binds the class to
g-recaptchato the DOM element allowing for automatic rendering of the recaptcha widget but this used to cause an issue where the widget is not rendered every time the page is loaded. Wrapping the loading of the script into a component gave consistency over rendering the reCaptcha widget if we make use of theinithook as described in the component lifecycle since we want to only load the script once and not every time the component is rerendered. Also there's no need to render the reCaptcha widget explicitly if we bind the component class tog-recaptchaand it makes for easier use unless there's a specific use case require hooking into the recaptcha script's callback.Anyways, here's a bit of code to explain its use:
Now you can simply use this component anywhere you want:
Testing this components is no straight-forward thing though!