【发布时间】:2020-09-09 10:20:16
【问题描述】:
我正在尝试在我的 AG-GRID 项目中使用材质组件。
我尝试按照网站示例 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'.
我已经按照here的说明安装了 ag grid community 和 angular
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 中导入更多内容吗? 我在这里做了什么非常愚蠢的事情吗?
谢谢
【问题讨论】: