How to Fix mat form field must contain a matformfieldcontrol error

The following code is actually wrong:

  <mat-form-field>
        <input matInput placeholder="Input name. please">
  </mat-form-field>

In fact, you just need to import the following modules:

imports: [
        MatFormFieldModule,
        MatInputModule,
    ]

Read More: