I'm trying to implement google recapcha, I can check if the user is a person with his help,
The reCapcha code calls the callback function named 'verifyCallback'in of my code. Next I want to call the AngularJS function written in the area of my controller.
Here are my codes so far -
Main Html, I turned on -
<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
Html partial -
var onloadCallback = function() { grecaptcha.render('loginCapcha', { 'sitekey' : 'someKey', 'callback' : verifyCallback, 'theme':'dark' }); }; var verifyCallback = function(response) {
AngularJS Controller -
var _myApp = angular.module('homeApp',[]); _myApp.controller('loginController',['$scope', function($scope){ $scope.auth = function() { console.log("Auth called"); } }]);
source share