I am trying to add angular material component. but the component did not work properly. that error said
Uncaught Error: Template parse errors: \'mat-option\
You need to import MatSelectModule in AppModule.ts
import {MatButtonModule, MatCheckboxModule, MatSelectModule} from '@angular/material';
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
MatButtonModule,
MatCheckboxModule,
MatFormFieldModule,
MatSelectModule
]
You need to import MatSelectModule
cause mat-option
are declared inside this module and add this into the AppModule
imports
import { ..., MatSelectModule, ... } from '@angular/material';
@NgModule({
imports: [ ..., MatSelectModule, ...]
})
export class AppModule { }
You need to import MatSelectModule
,
imports: [
BrowserModule,
FormsModule,
HttpModule,
MaterialModule,
MatSelectModule,
//..Other modules here
],