core.js:6162 ERROR Error: mat-form-field must contain a MatFormFieldControl. code example
Example 1: mat-form-field must contain a MatFormFieldControl
@NgModule({
imports: [
MatInputModule
],
exports: [
MatInputModule
]
})
Example 2: mat-form-field must contain a MatFormFieldControl
Maybe you need to close <input> tag:
<!-- Wrong -->
<mat-form-field>
<input matInput>
</mat-form-field>
<!-- Right -->
<mat-form-field>
<input matInput />
</mat-form-field>