【发布时间】:2020-03-08 08:05:41
【问题描述】:
我一直在阅读关于新项目的 ag-grid 的“入门”教程。已完成所有步骤,但出现错误提示
ag-Grid: could not find matching row model for rowModelType clientSide
ag-Grid: Row Model "Client Side" not found. Please ensure the ClientSideRowModelModule is loaded using: import '@ag-grid-community/client-side-row-model';
将我所有的代码与教程中提供的示例和一些 plunker 示例进行比较,并没有发现任何差异。尝试将 ClientSideRowModelModule 导入 app.module 但接口与请求的角度不匹配,因此无法正常工作。我没有想法,也找不到任何关于如何解决它的信息。
app.module.ts:
... imports: [
BrowserModule,
AppRoutingModule,
AgGridModule.withComponents([])
],...
app.cpmponent.html:
<ag-grid-angular
style="width: 500px; height: 500px;"
class="ag-theme-balham"
[rowData]="rowData"
[columnDefs]="columnDefs"
>
</ag-grid-angular>
app.component.ts:
...columnDefs = [
{headerName: 'Make', field: 'make' },
{headerName: 'Model', field: 'model' },
{headerName: 'Price', field: 'price'}
];
rowData = [
{ make: 'Toyota', model: 'Celica', price: 35000 },
{ make: 'Ford', model: 'Mondeo', price: 32000 },
{ make: 'Porsche', model: 'Boxter', price: 72000 }
];...
我正在使用 Angular:8.2.10,Angular CLI:8.2.2,npm:6.9.0
【问题讨论】:
标签: ag-grid-angular