Skip to content

Instantly share code, notes, and snippets.

@antonioribeiro
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonioribeiro/8756698 to your computer and use it in GitHub Desktop.
Save antonioribeiro/8756698 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en" ng-app="application">
<body class="theme-pattern-lightmesh" ng-controller="ApplicationController">
<head>
<script src="http://code.angularjs.org/1.2.10/angular.min.js"></script>
</head>
<form class="simple-form">
<input type="email" ng-model="user.email" placeholder="E-mail" />
<input type="email" ng-model="user.email_retyped" placeholder="Redigite o e-mail" />
<div class="error">{{ verifyEmail() }}</div>
</form>
<script>
var application = angular.module('application',[]);
application.controller('ApplicationController', ['$scope', function($scope) {
$scope.user = {};
$scope.verifyEmail = function()
{
if($scope.user.email !== $scope.user.email_retyped)
{
console.log($scope.user);
return 'error';
}
console.log($scope.user.email);
return '';
}
}]);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment