<h4 class="bg-primary">Change Email</h4>

<p><strong>Current Email:</strong> {{dealerInfo.currentUser.dealer_username}}</p>

<form name="chgEmailForm" novalidate>
  <div class="form-group">
    <input class="form-control" type="password" name="password" placeholder="Enter password"
           ng-model="dealerInfo.changeEmail.password" required>
    <p class="help-block" ng-show="chgEmailForm.password.$dirty && chgEmailForm.password.$error.required">This field is
      required.</p>

  </div>

  <div class="form-group">
    <input class="form-control" type="email" name="newEmail" placeholder="New email"
           ng-model="dealerInfo.changeEmail.new_email" required>
    <p class="help-block" ng-show="chgEmailForm.newEmail.$dirty && chgEmailForm.newEmail.$error.required">This field is
      required.</p>
  </div>

  <div class="form-group">
    <input class="form-control" type="email" name="confirmedNewEmail" placeholder="Confirm new email"
           ng-model="confirmedEmail" match="dealerInfo.changeEmail.new_email" required>
    <p class="help-block"
       ng-show="chgEmailForm.confirmedNewEmail.$dirty && chgEmailForm.confirmedNewEmail.$error.match">Your emails must
      match.</p>
    <p class="help-block"
       ng-show="chgEmailForm.confirmedNewEmail.$dirty && chgEmailForm.confirmedNewEmail.$error.required ">This field is
      required.</p>
  </div>
</form>

<button class="btn btn-primary" ng-disabled="chgEmailForm.$invalid" ng-click="save()">Save</button>
<a ui-sref="dealer-account-settings.main" class="btn btn-danger">Cancel</a>

