Trouble setting up sample table. "Could not find matching row model for rowModelType clientSide"

In your app.component.ts, you first need to import the ClientSideRowModelModule

import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';

Then inside the AppComponent class, you need to create a module array variable like this:

modules: Module[] = [ClientSideRowModelModule];

Finally, in your app.component.html, you need to bind it to the ag-grid-angular component

<ag-grid-angular 
style="width: 500px; height: 500px;" 
class="ag-theme-balham"
[rowData]="rowData" 
[columnDefs]="columnDefs"
[modules]="modules"
 >
</ag-grid-angular>

For further resource look at AgGrid's documentation, it is step 3 on installing AgGrid Modules.


I have been using the community version with no issues. I just downloaded a trial of enterprise and everything changed. When I ran into this issue, I learned that [modules]="modules" is required on the grid. That requires these two lines to be included on the component:

import { AllModules } from '@ag-grid-enterprise/all-modules';
modules: Module[] = AllModules;

I've never had to do this before in community version, but it quickly corrected the issue. The answer that was accepted above is stating what needs to happen when your application is integrating only individual modules. Per the documentation: "If you choose to select individual modules then at a minimum the a Row Model need to be specified. After that all other modules are optional depending on your requirements".


To solve this problem, I had to first import ModuleRegistry and AllCommunityModules in maint.ts and add ModuleRegistry.registerModules(AllCommunityModules); below just before platformBrowserDynamic().bootstrapModule(AppModule) like:

import { ModuleRegistry, AllCommunityModules } from '@ag-grid-community/all-modules';


ModuleRegistry.registerModules(AllCommunityModules);
platformBrowserDynamic().bootstrapModule(AppModule)
 .catch(err => console.error(err));

Lastly, in the component (e.g. users.component.ts) I used it by importing the AllCommunityModules and declaring the variable like:

import { AllCommunityModules } from '@ag-grid-community/all-modules';


public modules: Module[] = AllCommunityModules;

I got the idea from this answer here