NetanelBasal
6/3/2017 - 7:55 PM

recaptcha5.directive.ts

@Directive({
  selector: '[nbRecaptcha]'
})
export class ReCaptchaDirective implements OnInit, ControlValueAccessor {
  private onChange : ( value : string ) => void;
  private onTouched : ( value : string ) => void;

  constructor( private element : ElementRef ) {
  }

  ngOnInit() {
    this.registerReCaptchaCallback();
    this.addScript();
  }


  writeValue( obj : any ) : void {
  }

  registerOnChange( fn : any ) : void {
    this.onChange = fn;
  }

  registerOnTouched( fn : any ) : void {
    this.onTouched = fn;
  }

}