I am having trouble with implementing an Angular Material component. The component is not functioning properly, and I received the following error message:
Uncaught Error: Template parse errors: 'mat-option' is not a known element:
// ...
I suspect that the issue lies within app.module.ts
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { SidebarComponent } from './sidebar/sidebar.component';
import { PostsComponent } from './posts/posts.component';
import { UsersComponent } from './users/users.component';
import { DetailsComponent } from './details/details.component';
import { HttpClientModule } from '@angular/common/http';
import { FooterComponent } from './footer/footer.component';
import {MatButtonModule, MatCheckboxModule} from '@angular/material';
import {MatFormFieldModule} from '@angular/material/form-field';
import { MyFormComponent } from './my-form/my-form.component';
@NgModule({
declarations: [
AppComponent,
SidebarComponent,
PostsComponent,
UsersComponent,
DetailsComponent,
FooterComponent, MyFormComponent
],
imports: [
BrowserModule, AppRoutingModule,HttpClientModule,MatButtonModule, MatCheckboxModule,MatFormFieldModule
]
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }