3

I am trying to write a component library in Angular5. My library has a rich set of features/components. I am trying to use AgGrid Module in my component library.

I understand AgGrid Module needs to be aware of entryComponents at compile-time if i plan to use any of them in my grid. This leads me to an interesting problem.

@NgModule({
imports: [
    BrowserModule,
    AgGridModule.withComponents([
        ...
    ])
],
declarations: [
    AgGridComponent
],
exports: [
    AgGridComponent
]})  export class ComponentLibModule {}

I want to export my ComponentLibModule to be consumed by an application. The problem is, the application is going to define components which AgGridModule needs to treat as entryComponents.

How can i wrap my ComponentLibModule to return a decorated module which provides AgGrid with its entry components?

  • did you find a solution for that? The only thing I was able to get to work is defining a static property on `ComponentLibModule` and use that as parameter in `AgGridModule.withComponents` which is really hacky and ugly in my opinion – Arikael May 30 '18 at 13:03

0 Answers0