Error when converting AG Grid to enterprise

本小妞迷上赌 提交于 2019-12-24 19:25:26

问题


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?


回答1:


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));


来源:https://stackoverflow.com/questions/59196371/error-when-converting-ag-grid-to-enterprise

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!