ERROR Error: No value accessor for form control with unspecified name attribute

https://stackoverflow.com/questions/46465891/what-is-ngdefaultcontrol-in-angular/46465959

添加 ngDefaultControl

<label *ngIf="'datepicker' === item.type && i > 0 && (item.label.indexOf('至') > -1 || item.label.indexOf('止') > -1)" style="width:20%; text-align: center;"
    [formControlName]="item.name" id="{{item.name}}" ngDefaultControl>
    <span>至:</span>
</label>

 

posted @ 2021-09-16 16:05  xiluhua  阅读(622)  评论(0编辑  收藏  举报