mat-form-field must contain a MatFormFieldControl

前端 未结 30 1805
萌比男神i
萌比男神i 2020-11-28 04:35

We are trying to build our own form-field-Components at our Company. We are trying to wrap material design\'s Components like this:

field:



        
30条回答
  •  心在旅途
    2020-11-28 05:05

    Quoting from the official documentation here:

    Error: mat-form-field must contain a MatFormFieldControl

    This error occurs when you have not added a form field control to your form field. If your form field contains a native or element, make sure you've added the matInput directive to it and have imported MatInputModule. Other components that can act as a form field control include , , and any custom form field controls you've created.

提交回复
热议问题