我正在使用colorpicker来选择颜色,但我无法选择任何颜色。我得到了上面提到的错误。
<div class="col-sm-12 col-md-6">
<mat-form-field class="example-full-width">
<input matInput [(value)]="color" [cpOutputFormat]="'hex'" autocomplete="off" [(colorPicker)]="color"
[cpPosition]="'bottom'" placeholder="BG Color" formControlName="color"/>
</mat-form-field>
</div>
我还导入了它的模块
import { ColorPickerModule } from 'ngx-color-picker';
您是否检索AppointmentTypeModal
与ViewChild
装饰器或类似的距离?
尝试在ngAfterViewInit
中调用initializeFormFields
方法,而不是ngOnInit。