Skip to content

ObjectMetadataElementLabelDirective

directive

Directive to apply styles to an object metadata element label based on its control status. Depending on the state of the control (dirty, error, required), it will add or remove specific classes to the label element. These classes could then be used to style the label accordingly.

Could be placed on any HTML element, but is primarily intended for use on <mat-label> or <label> elements. If you would like to use it on any other element, make sure to add the class 'label' to it.

Example :

<mat-label [yuvObjectMetadataElementLabel]="ctx">My Label</mat-label>
<label [yuvObjectMetadataElementLabel]="ctx">My Label</label>
<div class="label" [yuvObjectMetadataElementLabel]="ctx">My Label</div>

Selector: [yuvObjectMetadataElementLabel]

Standalone: Yes

Implements: OnInit, AfterViewInit

Type: MetadataFormFieldContext

Type: unknown

Default Value: signal(\{ dirty: false, required: false, invalid: false \})