start angularizing sign up form

This commit is contained in:
Michael Q Larson
2015-01-09 17:52:19 -08:00
parent 99253a7745
commit 3e7da5ae98
6 changed files with 126 additions and 54 deletions

View File

@@ -54,3 +54,35 @@ profileValidation.controller('profileValidationController', ['$scope', '$http',
}
]);
profileValidation.controller('emailSignUpController', ['$scope',
function($scope) {
}
]);
profileValidation.directive('uniqueUsername', function($http) {
return {
restrict: 'A',
require: 'ngModel',
link: function (scope, element, attrs, ngModel) {
element.bind("keyup", function (event) {
ngModel.$setValidity('unique', true);
if (element.val()) {
$http.get("/api/checkUniqueUsername/" + element.val()).success(function (data) {
if (data) {
ngModel.$setValidity('unique', false);
}
});
}
});
}
};
});
profileValidation.controller('emailSignInController', ['$scope',
function($scope) {
}
]);