Last active
August 29, 2015 14:11
-
-
Save shadowhand/0bb2bf370462fa0ba227 to your computer and use it in GitHub Desktop.
Angular JS select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.changedRole; | |
$scope.changeRole = function() { | |
if (confirm('Are you sure you want set the role of selected users to ' + $scope.changedRole + '?')) { | |
alert('TODO [ not implemented ]'); | |
} | |
}; | |
$scope.roles = [ | |
{ | |
name: 'guest', | |
display_name: 'Guest', | |
}, | |
{ | |
name: 'user', | |
display_name: 'Member', | |
}, | |
{ | |
name: 'admin', | |
display_name: 'Admin', | |
} | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select ng-disabled="!selectedUsers.length" ng-model="changedRole" ng-change="changeRole()" | |
ng-options="role as role.display_name for role in roles"> | |
<option value>Change Role...</option> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment