Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I need your help. Since I'm new to Angular I'm trying a lot to make a good page and learn something. To make my form submit a bit safer, I've used this lib here to include Google reCaptchaV3 into my page:

https://www.npmjs.com/package/ng-recaptcha#example-basic-v3

I've followed the tutorial and added everything to my main app.modules.ts:

imports     : [
  RecaptchaV3Module,
  RecaptchaModule,
],
providers   : [
  ValidateRecaptchaService,
  {provide: RECAPTCHA_V3_SITE_KEY, useValue: 'XXXXXXXXXXXXXXX-5qwbFT5pN'}
],

After that I've went into my contact component with my contact form and created the check and everything. I found out that when I import the service:

private recaptchaV3Service: ReCaptchaV3Service

... the badge appears automatically on my page. But now I'm getting a problem. When I leave the page, the badge is still there but it shouldn't. Why is it still there? I've tried killing it in ngOnDestroy but the service has no termination method or something like this.

I know that I can use CSS but I want to understand the problem and solve it the right way. Thanks for your help!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
2.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...