![](/img/trans.png)
[英]ASSERTION ERROR: Type passed in is not ComponentType, it does not have 'ɵcmp' property
[英]Ag-Grid ASSERTION ERROR: Type passed in is not ComponentType, it does not have 'ɵcmp' property
我使用 angular 11.1.0 和 ag-grid 24.0.0
当我尝试使用 frameworkComponent @Input 加载动态 angular 组件时,我收到以下错误:断言错误:传入的类型不是 ComponentType,它没有“ɵcmp”属性。
这就是我在 HTML 中声明它的方式:
<ag-grid-angular style="width: 100%; height: 300px;" class="ag-theme-alpine" [frameworkComponents]="frameworkComponents" [rowData]="item.condittions", (gridReady)="onGridReady($event)" [columnDefs]="columnDefs">
在组件中:
frameworkComponents: { audianceCellRenderer: AssetsCellRendererComponent, };
columnDefs = [ {field: 'name'}, {field: 'sendEmail'}, {field: 'audiance', cellRendererFramework: 'audianceCellRenderer'}, {field: 'sop'}, ];
我尝试将组件添加到 entryComponents,尝试将组件添加到 Ag-grid 的 withComponnet 方法,但没有成功。
任何帮助,将不胜感激。
对于提出此问题的任何人,我的错误是这一行:
{字段:'观众,cellRendererFramework:'audianceCellRenderer'},
我不小心输入了组件的密钥,而不是组件本身。
我确定我不会再犯这个错误了:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.