Skip to content

Instantly share code, notes, and snippets.

@eupharis
Created January 10, 2014 19:54
Show Gist options
  • Save eupharis/8361418 to your computer and use it in GitHub Desktop.
Save eupharis/8361418 to your computer and use it in GitHub Desktop.
.directive('addRemoveUsers', ['$state', function($state) {
return {
link: function(scope, element, attrs) {
element.on('click', function() {
scope.$apply(function() {
if (scope.circle.all_circle) {
var msg = [
"An admin group's all circle contains all its users.",
"To remove users from this circle, please remove them",
"from the admin group."
].join(" ");
scope.alerter.add_alert({
"level": "danger",
"content": msg
});
} else {
$state.go('circle_manage.addremove_users');
}
});
});
}
};
}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment