All files / app/formly form-field.wrapper.ts

31.57% Statements 6/19
33.33% Branches 6/18
50% Functions 1/2
18.18% Lines 2/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2710x                                       10x            
import { CdkDragHandle } from '@angular/cdk/drag-drop';
import { Component, HostBinding } from '@angular/core';
import { FieldWrapper, FormlyFieldConfig } from '@ngx-formly/core';
 
@Component({
  selector: 'formly-wrapper-form-field',
  template: `
    <label cdkDragHandle [attr.for]="id" class="form-label" [class.required]="props.required">
      {{ props.label || '' }}
    </label>
    <ng-template #fieldComponent></ng-template>
    @if (props.hint) {
      <span><!-- Hint --></span>
      <div class="no-margin">
        <span class="hints">{{ props.hint }}</span>
      </div>
    }
  `,
  imports: [CdkDragHandle],
})
export class FormlyWrapperFormField extends FieldWrapper<FormlyFieldConfig> {
  @HostBinding('title')
  get title() {
    return this.props.title || '';
  }
}