我正在尝试从有角材料中将周数列添加到mat-datepicker组件中使用的mat-monthly-view组件中。我想扩展当前的垫子月视图,并在某种程度上告诉我的模块,当调用垫子月视图时,用我的扩展视图代替它。但是我找不到路。 Angular支持这种解决方案吗?
已更新
模块:
providers: [
{ provide: MatMonthView, useClass: MyMonthView},
]
componet:
@Component({
selector: 'my-month-view',
templateUrl: './monthly-view.component.html',
styleUrls: ['./monthly-view.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MyMonthView<D> extends MatMonthView<D> {
constructor(
_changeDetectorRef: ChangeDetectorRef,
@Inject(MAT_DATE_FORMATS) _dateFormats: MatDateFormats,
_dateAdapter: DateAdapter<D>
) {
super(
_changeDetectorRef,
_dateFormats,
_dateAdapter
);
}
}
我没有收到错误,但是datepicker月视图中的组件是相同的,而不是我的新组件。