Avatar ·

Angular Material में "mat-form-field must contain a MatFormFieldControl" त्रुटि

सभी को नमस्कार! मैं Angular और Angular Material में नया हूँ। मैं एक टेक्स्ट फील्ड के साथ एक सरल फॉर्म बनाने की कोशिश कर रहा हूँ, लेकिन कंसोल में यह त्रुटि मिल रही है: "mat-form-field must contain a MatFormFieldControl"। मेरे पास Angular 15 और Angular Material है। यहाँ मेरा 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 ``` मैंने app.module.ts में MatFormFieldModule import किया: ```typescript import { MatFormFieldModule } from '@angular/material/form-field'; @NgModule({ imports: [MatFormFieldModule], ... }) ``` लेकिन फिर भी त्रुटि आ रही है। मैंने MatInputModule जोड़ने की कोशिश की, लेकिन मदद नहीं मिली। मैं क्या गलत कर रहा हूँ? mat-form-field को input के साथ सही तरीके से कैसे उपयोग करें?