<div ng-controller="AppTeamCtrl" class="text-left"> <p>Team:</p> <table class="table table-hover table-bordered"> <tr ng-repeat="u in permissions" vertical-align="middle"> <td width="50%"> {{ u.username }}  <td width="50%"> {{ u.email}}  <td> <select class="btn btn-info" ng-model="u.permission" ng-options="p.id as p.name for p in all_permissions" ng-change="updateUser(u)" ng-disabled="!canWrite()"> </select>  <td ng-show="canWrite()"> <a class="btn btn-danger" ng-click="revokeUser(u)">Remove</a>   </table> <div ng-switch="error" class="text-right text-danger"> <p ng-switch-when="user_with_current_email_already_exist">User with this email already registered!</p> <p ng-switch-when="invalid_email">Invalid email!</p> <p ng-switch-when="email_is_empty">Email is empty!</p> <p ng-switch-when="invalid_email_format">Invalid email format!</p> <p ng-switch-when="invalid_email_length">Is User real has so long email!?<br>How does He remember it?</p> </div> <form name="addUserForm" ng-show="canWrite()" ng-submit="addUser(user_app)" novalidate> <div class="form-inline text-right" ng-init="user_app.app_key=app.app_key;user_app.permission='r'"> <label>Invite user to {{app.name}}: </label> <input class="form-control" type="text" id="username" ng-model="user_app.email"> <button class="btn btn-default" type="submit">Invite</button> </div> </form> </div>