📅  最后修改于: 2022-03-11 15:03:53.249000             🧑  作者: Mango
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;