
Live Demo - https://rajeshkumaryadav.com/#/auth
Step 1 - Install dependancy
Code: Select all
npm i ng-recaptcha --save
Code: Select all
import { RecaptchaModule } from 'ng-recaptcha';
Code: Select all
imports: [
RecaptchaModule,
],
yourcomponentname.component.html
Code: Select all
<re-captcha
(resolved)="resolved($event)"
siteKey="6LcOuyYTAAAAAHTjFuqhA52fmfJ_j5iFk5PsfXaU"
></re-captcha>
Code: Select all
public resolved(captchaResponse: string) {
console.log(`Resolved captcha with response: ${captchaResponse}`);
// Write your logic here about once human verified what action you want to perform
}
All done.