错误:表单控件的值访问器没有名称:' floatLabel'

时间:2018-02-08 13:32:58

标签: angular typescript angular-material2

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>

0 个答案:

没有答案