<app-common-dialog [dialogContent]="dialogContent" [dialogRef]="dialogRef">
  <ng-template #dialogContent>
    <form appFormSubmit (ngSubmit)="createUser()" [formGroup]="createUserForm" layoutDirection="column">
      <app-form-errors #formErrors [formGroup]="createUserForm"></app-form-errors>
      <mat-form-field>
        <mat-label i18n>Name</mat-label>
        <input matInput placeholder="Name" i18n-placeholder type="text" formControlName="name">
        <mat-error>{{createUserForm.controls.name.errors | errorFormatter}}</mat-error>
      </mat-form-field>
      <mat-form-field>
        <mat-label i18n>Password</mat-label>
        <input matInput placeholder="Password" i18n-placeholder
               [type]="(createUserForm.controls.password.value.length > 0)? 'password' : 'text'"
               formControlName="password">
        <mat-error>{{createUserForm.controls.password.errors | errorFormatter}}</mat-error>
      </mat-form-field>
    </form>
  </ng-template>
</app-common-dialog>
