Integrate reCAPTCHA into angularjs with form validation support.
Install via bower:
bower install angular-re-captcha --save
Include the file into your application:
<script type="text/javascript" src="bower_components/angular-re-captcha/angular-re-captcha.js"></script>
Your can have a look at the example. Basically you have to add reCAPTCHA to your dependencies, configure your key.
angular.module('myApp', ['reCAPTCHA'])
.config(function (reCAPTCHAProvider) {
// required: please use your own key :)
reCAPTCHAProvider.setPublicKey('---KEY---');
// optional: gets passed into the Recaptcha.create call
reCAPTCHAProvider.setOptions({
theme: 'clean'
});
});
and use the directive within a form. Make sure to set a ng-model
<form name="registerForm" role="form" novalidate>
<div re-captcha ng-model="user.captcha"></div>
<button type="submit" ng-disabled="registerForm.$invalid">Submit</button>
</form>
Type: function
Default: null
Sets the PublicKey
Type: function
Default: null
Sets the options, that get passed into the Recaptcha.create call. Here are a list of the available options
Pull requests are welcome. Please make sure that you include tests in your PR.