NGO-DB/ndb-core

View on GitHub
src/app/features/todos/recurring-interval/edit-recurring-interval/edit-recurring-interval.component.html

Summary

Maintainability
Test Coverage
<mat-form-field [formGroup]="parent">
  <mat-label>
    <fa-icon icon="repeat"></fa-icon>
    {{ label }}
  </mat-label>

  <mat-select
    [formControlName]="formControlName"
    [compareWith]="compareOptionFun"
  >
    <mat-option *ngFor="let o of predefinedIntervals" [value]="o.interval">
      {{ o.label }}
    </mat-option>

    <mat-option
      (onSelectionChange)="openCustomIntervalSelection($event)"
      i18n="recurring interval option"
      class="special-option"
    >
      <fa-icon icon="tools" [fixedWidth]="true"></fa-icon>
      define other interval
    </mat-option>

    <mat-option
      [value]="undefined"
      (onSelectionChange)="resetSelection()"
      i18n="recurring interval option"
      class="special-option"
    >
      <fa-icon icon="xmark" [fixedWidth]="true"></fa-icon>
      does not repeat
    </mat-option>
  </mat-select>

  <mat-error>
    <app-error-hint [form]="formControl"></app-error-hint>
  </mat-error>
</mat-form-field>