当我尝试在MatInputModule
的{{1}}中使用imports
时出现此错误
ReferenceError:未定义MatInputModule
我的app.module.ts文件如下:
@Ngmodule
example.component.html是:
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatNativeDateModule } from '@angular/material/core';
import { MatFormFieldModule } from '@angular/material/form-field';
@NgModule({
declarations: [..],
imports: [...,
MatDatepickerModule,
MatNativeDateModule,
MatFormFieldModule,
MatInputModule //<-----the error is generated when i add this
],
providers: [ ..., MatDatepickerModule],
example.component.ts是:
<mat-form-field>
<label class="col-md-4">attended date</label>
<input mdInput [matDatepicker]="mydatePicker">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #mydatePicker></mat-datepicker>
</mat-form-field>