AG-GRID 在没有 SystemJS 的情况下使用 material 个组件

AG-GRID Using material components without SystemJS

我正在尝试在我的 AG-GRID 项目中使用 material 个组件。

我尝试按照网站示例导入相关内容 here

import {GridOptions, Module, AllCommunityModules} from "@ag-grid-community/all-modules";

但是这会引发以下错误:

ERROR in src/app/components/shot/shot-list/shot-list.component.ts(33,56): error TS2307: Cannot find module '@ag-grid-community/all-modules'.

我已经按照说明安装了 ag grid community 和 angular here

npm install --save ag-grid-community ag-grid-angular

我已经检查过 npm list,它提供了以下安装版本:

+-- ag-grid@18.1.2
+-- ag-grid-angular@23.0.3
+-- ag-grid-community@23.0.2

我的 app.module.ts 有以下导入:

import { AgGridModule } from 'ag-grid-angular';

我没有使用 SystemJS。

我已经尝试过,当我尝试像这样直接从 'ag-grid-community' 导入时

import { GridOptions, Module, AllCommunityModules } from 'ag-grid-community';

它抛出以下错误:

ERROR in shot-list.component.ts(32,31): error TS2305: Module '"C:/Users/............/ag-grid-community/main"' has no exported member 'AllCommunityModules'.

我是否需要在 app.modules.ts 中导入更多内容? 我在这里做的真的很蠢吗?

谢谢

我不知道你想做什么,只是从导入中删除 ModuleAllCommunityModules

  • ag-grid-community 没有导出成员 Module.
  • ag-grid-community 没有导出成员 AllCommunityModules.

    import { GridOptions } from 'ag-grid-community';