Dwight Spencer
Dwight Spencer

Reputation: 21

Migrating from ag-grid-community to ag-grid-enterprise with Angular

I am already successfully using ag-grid-community in development. Now I wish to move to ag-grid-enterprise. I have my license. I following the rather ambiguous instructions in the Ag-Grid docs. But the docs don't work.

Docs say that I should be initialing a property [modules] of the enterprise grid. But there is no such property! And I do not know if I should remove the community version package in the vaguely-described installation process. Has anyone been through this migration?

Upvotes: 1

Views: 2859

Answers (1)

GreyBeardedGeek
GreyBeardedGeek

Reputation: 30088

No, you should not remove the community packages. The enterprise library is in addition to the community libraries, not instead of them.

AFAIK, all you should need to do is:

  • install the ag-grid-enterprise package (npm install)
  • add your license in main.ts, e.g.

    import {LicenseManager} from 'ag-grid-enterprise';
    
    LicenseManager.setLicenseKey(
      'your-license-key'
    );
    
  • In any module where you want to use the grid, import the required ag-grid modules, e.g.

    import { NgModule } from '@angular/core';
    import { CommonModule } from '@angular/common';
    import { AgGridModule } from 'ag-grid-angular';
    
    @NgModule({
      'imports': [
        CommonModule,
        AgGridModule.withComponents([])
      ]
    })
    export class MyModule {
    }
    

Upvotes: 2

Related Questions