<div ng-switch="$ctrl.group.public_description.length > 0">
  <p ng-switch-when="true">
    {{ $ctrl.group.public_description }}
  </p>
  <p ng-switch-default>
    <em translate="JOINGROUP.NO_PUBLIC_DESCRIPTION"></em>
  </p>
</div>
<form name="form" ng-submit="$ctrl.joinGroup()">
  <md-input-container ng-if="$ctrl.group.protected">
    <label translate="JOINGROUP.PASSWORD_LABEL"></label>
    <input name="password" ng-model="$ctrl.group.password" required type="text">
    <div ng-messages="form.password.$error">
      <div ng-message="required" translate="JOINGROUP.PASSWORD_REQUIRED"></div>
      <div ng-message="check" translate="JOINGROUP.PASSWORD_WRONG"></div>
    </div>
  </md-input-container>
  <div layout layout-align="end center">
    <md-button class="md-raised md-primary" type="submit">
      <i class="fa fa-arrow-circle-right"></i>
      <md-tooltip>
        <span translate="BUTTON.JOIN"></span>
      </md-tooltip>
    </md-button>
  </div>
</form>

<div ng-switch="$ctrl.group.public_description.length > 0">
  <p ng-switch-when="true">
    {{ $ctrl.group.public_description }}
  </p>
  <p ng-switch-default>
    <em translate="JOINGROUP.NO_PUBLIC_DESCRIPTION"></em>
  </p>
</div>
<form name="form" ng-submit="$ctrl.joinGroup()">
  <md-input-container ng-if="$ctrl.group.protected">
    <label translate="JOINGROUP.PASSWORD_LABEL"></label>
    <input name="password" ng-model="$ctrl.group.password" required type="text" ng-keypress="form.password.$setValidity('check',true)">
    <div ng-messages="form.password.$error">
      <div ng-message="required" translate="JOINGROUP.PASSWORD_REQUIRED"></div>
      <div ng-message="check" translate="JOINGROUP.PASSWORD_WRONG"></div>
    </div>
  </md-input-container>
  <div layout layout-align="end center">
    <md-button class="md-raised md-primary" type="submit" ng-disabled="!form.$valid">
      <i class="fa fa-arrow-circle-right"></i>
      <md-tooltip>
        <span translate="BUTTON.JOIN"></span>
      </md-tooltip>
    </md-button>
  </div>
</form>

Disable button if form is invalid
Disable button if form is invalid

Also requires that the server check status is reset after keypress
