<div *ngIf="error" class="alert alert-danger">{{ error }}</div>

<form role="form" (ngSubmit)="changePassword()" [formGroup]="form">

  <label i18n for="current-password">Change password</label>
  <my-input-toggle-hidden formControlName="current-password"
                          inputId="current-password"
                          i18n-placeholder placeholder="Current password"
                          [ngClass]="{ 'input-error': formErrors['current-password'] }"
                          autocomplete="current-password"></my-input-toggle-hidden>
  <div *ngIf="formErrors['current-password']" class="form-error">
    {{ formErrors['current-password'] }}
  </div>

  <my-input-toggle-hidden formControlName="new-password"
                          inputId="new-password"
                          i18n-placeholder placeholder="New password"
                          [ngClass]="{ 'input-error': formErrors['new-password'] }"
                          autocomplete="new-password"></my-input-toggle-hidden>
  <div *ngIf="formErrors['new-password']" class="form-error">
    {{ formErrors['new-password'] }}
  </div>

  <my-input-toggle-hidden formControlName="new-confirmed-password"
                          inputId="new-confirmed-password"
                          i18n-placeholder placeholder="Confirm new password"
                          [ngClass]="{ 'input-error': formErrors['new-confirmed-password'] }"
                          autocomplete="new-password"></my-input-toggle-hidden>
  <div *ngIf="formErrors['new-confirmed-password']" class="form-error">
    {{ formErrors['new-confirmed-password'] }}
  </div>

  <input type="submit" i18n-value value="Change password" [disabled]="!form.valid">
</form>
