<app-common-dialog [dialogContent]="dialogContent" [dialogRef]="dialogRef">
  <ng-template #dialogContent>
    <form appFormSubmit (ngSubmit)="addChoice()" [formGroup]="editChoiceForm" layoutDirection="column">
      <app-form-errors #formErrors [formGroup]="editChoiceForm"></app-form-errors>
      <mat-form-field>
        <mat-label i18n>Label</mat-label>
        <input matInput type="text" formControlName="label" placeholder="Label" i18n-placeholder required>
        <mat-error>{{backendErrors['label'] | fieldRequired}}</mat-error>
      </mat-form-field>
      <mat-form-field>
        <mat-label i18n>Choice value</mat-label>
        <input matInput type="text" formControlName="choice" placeholder="Choice value" i18n-placeholder required>
        <mat-error>{{backendErrors['choice'] | fieldRequired}}</mat-error>
      </mat-form-field>
      <mat-form-field>
        <mat-label i18n>Move to position (starting from 0)</mat-label>
        <input matInput type="number" formControlName="position" placeholder="Position" i18n-placeholder [step]="1">
        <mat-error>{{backendErrors['position'] | fieldRequired}}</mat-error>
      </mat-form-field>
    </form>
  </ng-template>
</app-common-dialog>
