clr-text.component.html 987 B

1234567891011121314151617181920212223242526272829
  1. <clr-input-container *ngIf="!link; else fieldWithLink">
  2. <label [ngClass]="{ 'label-error': control.touched && control.invalid }">{{ label }}</label>
  3. <input clrInput type="text"
  4. [formControl]="control"
  5. [placeholder]="placeholder"
  6. (keyup)="handleKeyup($event.target.value)"
  7. spellcheck="false"
  8. >
  9. <clr-control-error>{{ getFirstFailureMsg() }}</clr-control-error>
  10. </clr-input-container>
  11. <ng-template #fieldWithLink>
  12. <clr-input-container>
  13. <label [ngClass]="{ 'label-error': control.touched && control.invalid }">{{ label }}</label>
  14. <input clrInput type="text"
  15. #field
  16. [formControl]="control"
  17. [placeholder]="placeholder"
  18. (keyup)="handleKeyup($event.target.value)"
  19. spellcheck="false"
  20. >
  21. <clr-control-error>{{ getFirstFailureMsg() }}</clr-control-error>
  22. </clr-input-container>
  23. <div class="input-group-append">
  24. <button class="btn btn-sm" type="button" [routerLink]="[ link.route, field.value ]">{{ link.label || 'Details' }}</button>
  25. </div>
  26. </ng-template>