我正在尝试对包含基于角度材料的数据表的角度(4)组件进行单元测试。
我试图模仿许多指令,例如<md-row cdkColumnDef="title">
,但cdkColumnDef
导致我出现问题,因为以下内容不起作用:
@Component({
selector: 'md-row',
template: `<p>Table</p>`
})
class MockContainer {
@Input() cdkHeaderRowDef;
}
有了这个,我得到了错误:
Error: Template parse errors:
'md-row' is not a known element:
1. If 'md-row' is an Angular component, then verify that it is part of this module.
2. If 'md-row' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<!-- ID Column -->
[ERROR ->]<md-row cdkColumnDef="id">
<md-header-cell *cdkHeaderCellDef md-sort-header> ID </md-header-cell>
<md-cell *cdkCellD"): ng:///DynamicTestModule/JobOverviewComponent.html@7:12
如何公开不需要方括号的可绑定属性,例如@Input()
&gt;