我一直在阅读有关新项目中的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';
将我的所有代码与教程中提供的示例以及一些更简单的示例进行了比较,并且没有发现任何差异。尝试将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