Hemen Ashodia
Hemen Ashodia

Reputation: 509

How can I use Google's Invisible Captcha with AngularJs?

Very recently invisible Captcha is released by google. https://www.google.com/recaptcha/intro/invisible.html

Is there a way to integrate this system with help of AngularJS?

Clarification This question is not about regular reCaptcha from Google. I am asking about Invisible reCaptcha. Here is the detailed situation.

My registration form is already using AngularJS. The form submission is triggered by AngularJS standards. The invisible reCaptcha requires me to give callback function for form submission. Which is confusing part.

Upvotes: 3

Views: 1823

Answers (1)

Chtioui Malek
Chtioui Malek

Reputation: 11515

You cannot reference directly the angularJs function inside the invisible reCAPTCHA data-callback, it expects a global function, so the solution i came up with is :

$scope.login = function (token) {
  // your login logic
}
$window.login = $scope.login;

then you can use data-callback="login" inside your login button.

hope this helps.

Upvotes: 2

Related Questions