0

My project consists of two seperate Angular Apps that have to share a module. It's working perfectly in App A but when I create a relative import from App B to A it throws a StaticInjectorError.

ERROR Error: StaticInjectorError(AppModule)[AgGridNg2 -> ComponentFactoryResolver]: 
  StaticInjectorError(Platform: core)[AgGridNg2 -> ComponentFactoryResolver]: 
    NullInjectorError: No provider for ComponentFactoryResolver!

I was hoping to just change the import path in App B so that it points to the module in App A.

Like this: App A (This works just fine):

import { GridModule } from './grid/grid.module';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    GridModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

App B:

import { GridModule } from '../../../qtgridview/src/app/grid/grid.module';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    GridModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

The module in question:

@NgModule({
  imports: [
    CommonModule,
    AgGridModule.withComponents([
      IconCellRendererComponent
    ])
  ],
  providers: [],
  declarations: [GridComponent, IconCellRendererComponent],
  exports: [GridComponent]
})
export class GridModule { }

Ist this possible? How would I go about including a module in such a way? Thanks in advance

Jason
  • 654
  • 1
  • 11
  • 27

0 Answers0