在Angular-7中实现MatSelectModule
模块时出现以下错误。
错误:
Uncaught ReferenceError: MatSelectModule is not defined
at app.module.ts:21
我的代码如下:
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef> Type </th>
<td mat-cell *matCellDef="let element">
<mat-select [(ngModel)]="element.active">
<mat-option [value]="active" *ngFor="let active of activeList">
{{ active }}
</mat-option>
</mat-select>
</td>
</ng-container>
我在这里使用mat-select
作为下拉列表。
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 { MultipleMatTableTaskComponent } from './multiple-mat-table-task/multiple-mat-table-task.component';
import { MaterialModule } from './material.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
declarations: [
AppComponent,
MultipleMatTableTaskComponent,
],
imports: [
BrowserModule,
MaterialModule,
AppRoutingModule,
BrowserAnimationsModule,
MatSelectModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
我在这里导入MatSelectModule
,但仍然显示错误。在这里,我需要使用mat-select