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

76.47% Statements 13/17
94.44% Branches 17/18
100% Functions 2/2
72.72% Lines 8/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 27 2811x             11x 11x 10x 10x 11x                   21x     11x      
import { CdkDragHandle } from '@angular/cdk/drag-drop';
import { Component, HostBinding, ChangeDetectionStrategy } 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>
    }
  `,
  changeDetection: ChangeDetectionStrategy.Eager,
  imports: [CdkDragHandle],
})
export class FormlyWrapperFormField extends FieldWrapper<FormlyFieldConfig> {
  @HostBinding('title')
  get title() {
    return this.props.title || '';
  }
}