angular.module('gokibitz.directives')
.directive('uniqueUsername', function ($http) {
	return {
		restrict: 'A',
		require: 'ngModel',
		link: function (scope, element, attrs, ngModel) {
			function validate(value) {
				if (!value) {
					ngModel.$setValidity('unique', true);
					return;
				}
				$http.get('/auth/check_username/' + value).success(function (user) {
					if (!user.exists) {
						ngModel.$setValidity('unique', true);
					} else {
						ngModel.$setValidity('unique', false);
					}
				});
			}

			scope.$watch(function () {
				return ngModel.$viewValue;
			}, validate);
		}
	};
});


@@ -341,15 +341,12 @@
 ue).
-success
+then
 (fun
@@ -364,34 +364,8 @@
 ) %7B%0A
-%09%09%09%09%09if (!user.exists) %7B%0A%09
 %09%09%09%09
@@ -400,80 +400,22 @@
 e', 
-true);%0A%09%09%09%09%09%7D else %7B%0A%09%09%09%09%09%09ngModel.$setValidity('unique', false);%0A%09%09%09%09%09%7D
+!user.exists);
 %0A%09%09%09

Simplify logic here