【问题标题】:AG-GRID Using material components without SystemJSAG-GRID 使用没有 SystemJS 的材料组件
【发布时间】: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 中导入更多内容吗? 我在这里做了什么非常愚蠢的事情吗?

谢谢

【问题讨论】:

    标签: ag-grid ag-grid-angular


    【解决方案1】:

    我不知道您要做什么,但只需从导入中删除 Module 和 AllCommunityModules。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-09-15
      • 2020-01-02
      • 1970-01-01
      • 2021-03-14
      • 1970-01-01
      • 1970-01-01
      • 2021-10-15
      相关资源
      最近更新 更多