我想在我的材料日期范围选择器中添加操作按钮。所以我在下面链接的文档中添加了这段代码
文档链接:日期选择器操作
<mat-date-range-picker #picker [touchUi]="true"> <mat-date-range-picker-actions> <button mat-button matDateRangePickerCancel>Cancel</button> <button mat-raised-button color="primary" matDateRangePickerApply> Apply </button> </mat-date-range-picker-actions> </mat-date-range-picker>
但是当我运行应用程序时出现错误:'mat-date-range-picker-actions' is not a known element
我也导入了MatDatepickerModule
,MatNativeDateModule
但仍然出现此错误。没有操作按钮,它工作正常,