<div class="editor-container">
  <h4 class="bg-primary">Registration</h4>

  <form name="loginForm" ng-submit="loginForm.$valid && register()" enter-press="loginForm.$valid && register()"
        novalidate>

    <div class="form-group">
      <input class="form-control" type="text" name="email" placeholder="Email" ng-model="credentials.email"
             ng-pattern="/^[a-z0-9](_(?!(\.|_))|\.(?!(_|\.))|[a-z0-9]|@){4,50}[a-z0-9]$/i" required>
      <p class="help-block" ng-show="loginForm.email.$error.required && loginForm.email.$dirty">Please enter an email
        address.</p>
      <p class="help-block" ng-show="loginForm.email.$error.pattern && loginForm.email.$dirty">Email must be 4 to 50
        characters, containing only alphanumeric characters, periods, and underscores.</p>
    </div>

    <div class="form-group">
      <input class="form-control" type="password" name="password" placeholder="Password" ng-model="credentials.password"
             required>
      <p class="help-block" ng-show="loginForm.password.$error.required && loginForm.password.$dirty">Please enter a
        password.</p>
    </div>

    <div class="form-group">
      <input class="form-control" type="password" name="confirmed_password" placeholder="Confirm password"
             ng-model="confirmed_password" match="credentials.password" required>
      <p class="help-block" ng-show="loginForm.confirmed_password.$error.match && loginForm.confirmed_password.$dirty">
        The specified passwords do not match.</p>
    </div>

    <button class="btn btn-primary pull-right" type="submit" ng-disabled="loginForm.$invalid">Save</button>
  </form>

</div>