123456789101112131415161718192021 |
- <clr-select-container *ngIf="!link; else fieldWithLink" [ngClass]="{ 'touched-and-valid': control.touched && control.valid }">
- <label [ngClass]="{ 'label-error': control.touched && control.invalid }">{{ label }}</label>
- <select clrSelect [formControl]="control" (change)="handleChange()">
- <option *ngFor="let opt of options" [value]="opt.value">{{ opt.label }}</option>
- </select>
- <clr-control-error>{{ getFirstFailureMsg() }}</clr-control-error>
- </clr-select-container>
- <ng-template #fieldWithLink>
- <clr-select-container class="clr-input-group clr-input-group-sm" [ngClass]="{ 'touched-and-valid': control.touched && control.valid }">
- <label [ngClass]="{ 'label-error': control.touched && control.invalid }">{{ label }}</label>
- <select [formControl]="control" clrSelect #field (change)="handleChange()">
- <option *ngFor="let opt of options" [value]="opt.value">{{ opt.label }}</option>
- </select>
- <div class="clr-input-group-append">
- <button class="btn btn-outline-primary" type="button" (click)="navigate(field)">{{ link.label || 'Details' }}</button>
- </div>
- <clr-control-error>{{ getFirstFailureMsg() }}</clr-control-error>
- </clr-select-container>
- </ng-template>
|