0

I have used IntegralUIModule to implement TreeGrid but having issue with module implementation. As CommonModule also present in IntegralUIModule which is from Node_Modules

ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.

My Custom module.ts:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
// import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { PanelsModule } from 'src/app/shared/panels/panels.module';
import { GLGDemoComponent } from './glg-demo1/glg-demo.component';
import { GLGDemo2Component } from './glg-demo2/glg-demo2.component';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { IntegralUIModule } from '../../../../node_modules/@lidorsystems/integralui-web/bin/integralui/integralui.module';

@NgModule({
  declarations: [GLGDemoComponent, GLGDemo2Component],
  providers: [],
  imports: [
    CommonModule,
    FormsModule,
    PanelsModule,
    ReactiveFormsModule,
    IntegralUIModule,
    RouterModule.forChild([
      { path: '', pathMatch: 'full', component: GLGDemoComponent, data: { breadcrumbs: ['GLG', 'Screen 1'] } },
      { path: 'screen1', component: GLGDemoComponent, data: { breadcrumbs: ['GLG', 'Screen 1'] } },
      { path: 'TreeGrid', component: GLGDemo2Component, data: { breadcrumbs: ['Tree Grid', 'Grid'] } },
     ])
  ]
})
export class GLGDemoModule { }
  • Import BrowserModule, BrowserAnimationsModule, HttpModule or HttpClientModule only once, preferably in your root module.Check this thread:https://stackoverflow.com/questions/45975675/lazy-loading-browsermodule-has-already-been-loaded – huan feng Jul 23 '20 at 06:43
  • You need to remove import of BrowserModule from your custom module file – Piyush Jul 23 '20 at 06:43
  • Also, it seems like you need to change your import to: `import { IntegralUIModule } from '@lidorsystems/integralui-web'` – Poul Kruijt Jul 23 '20 at 07:10
  • Still not working.. – Yogesh Patil Jul 23 '20 at 07:19

0 Answers0