首页 > 解决方案 > Angular v8 中的 Google Recaptcha v2 图像

问题描述

我在 Angular v8 应用程序中使用 ngx-recaptcha2 ( https://www.npmjs.com/package/ngx-captcha )。

我在 app.module.ts 中包含了 NgxCaptchaModule 并添加到了消费者组件中

<ngx-recaptcha2 #captchaElem
  [siteKey]="siteKey"
    (reset)="handleReset()"
    (expire)="handleExpire()"
    (load)="handleLoad()"
    (success)="handleSuccess($event)"
    (error)="handleError($event)"
    [useGlobalDomain]="false"
    [size]="normal"
    [hl]="en"
    [theme]="dark"
    [type]="image" />
When the user keeps entering the wrong image validation, there is a message in the captcha which displays as "Please try again" as below image.

[![Error message displayed when user selects wrong images][1]][1]


So, in this case, how to get a callback/response of this error message to the rendered component from the recaptcha?


Any help here would be appreciated. Thank you!

  [1]: https://i.stack.imgur.com/DtFvL.png

标签: angularrecaptcha

解决方案


推荐阅读