我有一个DOM元素:
<mat-radio-group [formControlName]="field.name" [disabled]="field?.disabled">
<div>
<mat-label>{{ placeholder }}</mat-label>
</div>
<mat-radio-button *ngFor="let option of field.options" [value]="option.value">
{{ option.label }}
</mat-radio-button>
</mat-radio-group>
如何为mat-radio-button
或mat-radio-group
设置本机占位符?
这可能会帮助:
<fieldset>
<legend>
<label [attr.for]="aaa">PlaceHolder</label>
</legend>
<div class="row">
<mat-radio-group aria-label="Select an option">
<mat-radio-button value="1">Option 1</mat-radio-button>
<mat-radio-button value="2">Option 2</mat-radio-button>
</mat-radio-group>
</div>
</fieldset>
外观: