Skip to content

Commit c84514b

Browse files
authored
Merge pull request #24 from nbrookie/onrender-docs
Add documentation for the onRender option
2 parents b963f56 + ee3b674 commit c84514b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,29 @@ then you'll be able to invoke `resetReCaptcha()` method on `gRecaptcha` property
8989
this.get('gRecaptcha').resetReCaptcha();
9090
```
9191

92+
### onRender Callback
93+
94+
You might want to pass a callback function that will be called after the reCaptcha renders on the page. This is great for things like loading spinners. To do so, you can do something like this:
95+
96+
```
97+
{{g-recaptcha onSuccess=(action "onCaptchaResolved")
98+
onRender=(action "onCaptchaRendered") }}
99+
100+
```
101+
102+
then in your component or controller 's actions:
103+
104+
```js
105+
actions: {
106+
onCaptchaResolved() {
107+
// ...
108+
},
109+
onCaptchaRendered() {
110+
// your custom onRender logic
111+
}
112+
}
113+
```
114+
92115
### Customization
93116

94117
You can pass `g-recaptcha` the following properties:

0 commit comments

Comments
 (0)