Error: No value accessor for form control with name: 'floatLabel'.
我使用了链接
中的演示代码https://stackblitz.com/angular/moyrdxvdbdxv
https://material.angular.io/components/form-field/examples
HTML
<div class="example-container">
<form class="example-container" [formGroup]="options">
<mat-checkbox formControlName="hideRequired">Hide required marker</mat-checkbox>
<div>
<label>Float label: </label>
<mat-radio-group formControlName="floatLabel">
<mat-radio-button value="auto">Auto</mat-radio-button>
<mat-radio-button value="always">Always</mat-radio-button>
<mat-radio-button value="never">Never</mat-radio-button>
</mat-radio-group>
</div>
</form>