Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function checkSlugAvailability(slug) {
if (slug) {
$scope.$apply(function() {
$q.when((new ProfileSlugModel({
id: slug
})).exists(), function(result) {
if (result) {
isSlugAvailable = false;
} else {
isSlugAvailable = true;
}
}, function() {
isSlugAvailable = null;
});
};
}
}
}
function isSlugAvailable() {
//whatevs
}
this.isSlugAvailable = isSlugAvailable;
this.checkSlugAvailability = checkSlugAvailability;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.