title: Uncaught Error: Unexpected directive 'MatFormField' imported by the module 'AppModule'. Please add a @NgModule annotation
body: <p>I Want to use Angular Material Date picker but I am getting this error.</p>
  
  <blockquote>
    <p>Uncaught Error: Unexpected directive 'MatFormField' imported by the module 'AppModule'. Please add a @NgModule annotation.</p>
  </blockquote>
  
  <p>app.component.html</p>
  
  <pre><code>&lt;mat-form-field&gt;
    &lt;input matInput [matDatepicker]="picker" placeholder="Choose a date"&gt;
    &lt;mat-datepicker-toggle matSuffix [for]="picker"&gt;&lt;/mat-datepicker-toggle&gt;
    &lt;mat-datepicker #picker&gt;&lt;/mat-datepicker&gt;
  &lt;/mat-form-field&gt;
  </code></pre>
  
  <p>app.module.ts</p>
  
  <pre><code>import { BrowserModule } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  
  import { AppComponent } from './app.component';
  import {MatFormField} from '@angular/material';
  
  @NgModule({
    declarations: [
      AppComponent
    ],
    imports: [
      BrowserModule,
      MatFormField
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  export class AppModule { }
  </code></pre>