我正在尝试将周数列添加到来自角度材料的 mat-datepicker 组件中使用的 mat-monthly-view 组件。我想扩展当前的 mat-monthly-view ,并在某种程度上告诉我的模块,当调用 mat-monthly-view 时用我的扩展视图替换它。但我找不到路。 Angular 支持这种解决方案吗?
UPDATED
Module:
providers: [
{ provide: MatMonthView, useClass: MyMonthView},
]
组件:
@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
);
}
}
我没有收到错误,但日期选择器月视图中的组件是相同的,而不是我的新组件。
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)