mat-form-field must contain a MatFormFieldControl

前端 未结 30 1791
萌比男神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 04:46

    If all of the main code structure/configuration answers above don't solve your issue, here's one more thing to check: make sure that you haven't in some way invalidated your tag.

    For instance, I received the same mat-form-field must contain a MatFormFieldControl error message after accidentally putting a required attribute after a self-closing slash /, which effectively invalidated my . In other words, I did this (see the end of the input tag attributes):

    wrong:

    
    

    right:

    
    
    

    If you make that mistake or something else to invalidate your , then you could get the mat-form-field must contain a MatFormFieldControl error. Anyway, this is just one more thing to look for as you're debugging.

提交回复
热议问题