How to use reset () method CaptchaModule primeng Angular

0

I ask for your help because I have problems with the CaptchaModule component because I refresh the page and I get the following Recaptcha is not loaded

Html

<p-captcha [siteKey]="llave (onResponse)="showResponse($event)">
</p-captcha>

Ts

showResponse ( event ) {
  console.log ( "Evento: ", event.response );
}
    
asked by Gdaimon 16.05.2017 в 08:52
source

1 answer

1

You have a syntax error in your HTML, you do not close the property [siteKey] well and you can not execute the event (onResponse)

<p-captcha [siteKey]="llave (onResponse)="showResponse($event)"></p-captcha>

I also recommend that you use the DOM of your 'captcha' component to verify that you are sending a siteKey in response to your method

HTML:

<p-captcha #captcha [siteKey]="llave" (onResponse)="showResponse($event)"></p-captcha>

TS:

@ViewChild('captcha') cap;

constructor() { }

showResponse(event) {
  console.log("Propiedad", this.cap.siteKey);
  console.log("Evento: ", JSON.stringify(event.response));
  // 
  this.cap.reset();
}
    
answered by 31.08.2017 / 17:34
source