Reputation: 33
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?
Upvotes: 2
Views: 4273
Reputation: 2510
Fine. let's proceed installation step by step
npm i --save ag-grid-angular
npm i --save ag-grid-community
npm i --save ag-grid-enterprise
app.module.ts
import {AgGridModule} from "ag-grid-angular";
@NgModule({
imports: [
AgGridModule.withComponents([])]
})
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));
Upvotes: 2