Captcha en angularjs

Added by: Sam Deering





Stars: 4

Watchers: 4

Forks: 0

Module Description

Captcha in your forms with AngularJS

┬┐How to use?

Create new view file and add the next code

```html Captcha in Angular
Captcha con angularjs
            <div class="large-2 columns captcha">
                <!--add captcha to form-->
                <captcha field1="{{field1}}" operator="{{operator}}" field2="{{field2}}"></captcha>
            <div class="large-1 columns resultado">
                <!--campoo que hace de respuesta a nuestro captcha-->
                <input ng-model="resultado" size="1" required />

            <button type="submit" ng-disabled="!loginUserForm.$valid" ng-click="login(user)" class="button expand round">

<!--load js files angularjs, captcha.js and app.js-->
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="captcha.js"></script>
<script type="text/javascript" src="app.js"></script>

Check if is correctly

```js //inject the captcha factory our module var app = angular.module("app", ["udpCaptcha"]);

//inject the captcha factory our controller app.controller("homeController", function($scope, $captcha) {
//create a function, for example to make a login form //and check if the captcha passes validation $scope.login = function(user) { //correct if($captcha.checkResult($scope.resultado) == true) { alert("Correct"); } //error captcha else { alert("Error"); } } });

## Visit me

* [Visit me](

Module stats last updated: 2015-06-07 05:30:25

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!