Skip to content

Instantly share code, notes, and snippets.

@tangorri
Created November 5, 2013 15:37
Show Gist options
  • Save tangorri/7320937 to your computer and use it in GitHub Desktop.
Save tangorri/7320937 to your computer and use it in GitHub Desktop.
angular.module('App').controller('AccountCtrl', function($scope, Account, Profile) {
$scope.login = '';
$scope.password = '';
$scope.passwordConfirm = '';
function signin() {
Account.signin($scope.login, $scope.password);
}
function signout() {
Account.signout();
}
function signup() {
Account.signup($scope.login, $scope.password, $scope.passwordConfirm, 1, 1);
}
$scope.onSinginSubmit = function() {
signin();
};
$scope.onSignOutPressed = function() {
signout();
};
$scope.onSingupSubmit = function() {
signup();
};
});
<form name="signupForm" ng-submit="onSingupSubmit()">
<div class="account-form white-rounded-top">
<h3 translate>PAGE_ACCOUNT.SIGNUP</h3>
<input ng-model="login" type="email" name="login" placeholder="{{'PAGE_ACCOUNT.EMAIL' | translate }}">
<input ng-model="password" type="password" name="password" placeholder="{{'PAGE_ACCOUNT.PASSWORD' | translate }}">
<input ng-model="passwordConfirm" type="password" name="password_confirmation" placeholder="{{'PAGE_ACCOUNT.PASSWORD_CONFIRM' | translate }}">
<button translate class="validation-btn">PAGE_ACCOUNT.SIGNUP</button>
<a translate href="#/Account/Signin/" class="small_link">PAGE_ACCOUNT.ALLREADY_HAVE_ACCOUNT</a>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment