将AG Grid转换为企业时出错 [英] Error when converting AG Grid to enterprise

查看:159
本文介绍了将AG Grid转换为企业时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试将使用AG Grid免费版的项目转换为企业免费试用版。但是,按照AG Grid网站上的说明进行操作时,出现此错误:



未捕获的TypeError:无法读取未定义的属性'EnterpriseCoreModule'



认为这可能是由于我创建的项目导致我尝试在一个新项目上构建,但仍然遇到相同的错误。 / p>

有人遇到此错误吗?在网上查看,没有找到任何结果。有人可以帮助将我的AG Grid激活到企业吗?

解决方案

好。
让我们逐步进行安装


  1. 安装所有依赖项



  npm i-保存ag-grid-angular 
npm i-保存ag-grid-community
npm i-保存ag-grid-enterprise




  1. 进口部门 app.module.ts



 导入{AgGridModule}来自 ag-grid-angular; 
@NgModule({
进口:[
AgGridModule.withComponents([])]
})




  1. 导入ag-Grid样式-以 styles.scss



  @import〜@ ag-grid-community / all-modules / dist / styles / ag- grid.css; 
@import ~@ag-grid-community/all-modules/dist/styles/ag-theme-balham.css;

4。在 main.ts



但是模块的顺序很重要!


我们建议在引导应用程序之前,在主引导文件(通常命名为main.ts或boot.ts)中设置许可证密钥。




  import {LicenseManager} from ag-grid-enterprise; 


LicenseManager.setLicenseKey( YOUR_KEY);
platformBrowserDynamic() .bootstrapModule(AppModule).catch(err => console.error(err));


I am currently trying to convert a project I have that is using AG Grid free to enterprise free trial. However, when following the instructions on the AG Grid site I am getting this error:

Uncaught TypeError: Cannot read property 'EnterpriseCoreModule' of undefined

Thinking it might probably be due to the project I created I tried building on a new one but I am still getting the same error.

Has anyone encountered this error? Looked on the net and could didn't find any results. Can anyone help in activating my AG Grid to enterprise?

解决方案

Fine. let's proceed installation step by step

  1. install all dependencies

npm i --save ag-grid-angular
npm i --save ag-grid-community
npm i --save ag-grid-enterprise

  1. import deps in app.module.ts

import {AgGridModule} from "ag-grid-angular";
@NgModule({
    imports: [
        AgGridModule.withComponents([])]
})

  1. import ag-Grid styles - in styles.scss

@import "~@ag-grid-community/all-modules/dist/styles/ag-grid.css";
@import "~@ag-grid-community/all-modules/dist/styles/ag-theme-balham.css";

4.setting the license key in main.ts

but the order of the modules is IMPORTANT!

We recommend setting the license key in your main boot files (typically named either main.ts or boot.ts, before you bootstrap your application.

import { LicenseManager } from "ag-grid-enterprise";


LicenseManager.setLicenseKey("YOUR_KEY");
platformBrowserDynamic().bootstrapModule(AppModule).catch(err => console.error(err));

这篇关于将AG Grid转换为企业时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆