Error "mat-form-field must contain a MatFormFieldControl" in Angular Material
Hello everyone! I'm new to Angular and Angular Material. I'm trying to make a simple form with a text field, but I'm getting an error in the console: "mat-form-field must contain a MatFormFieldControl".
I have Angular 15 and Angular Material. Here is my component code:
**app.component.ts:**
```typescript
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'my-form-app';
}
```
**app.component.html:**
```html
```
I imported MatFormFieldModule in app.module.ts:
```typescript
import { MatFormFieldModule } from '@angular/material/form-field';
@NgM
No answers yet.
Log in to leave an answer