I have many feature modules which imports DataGridModule. When I traverse such that when one feature module is loaded and navigate to another feature module, I get the below error,
EXCEPTION: Uncaught (in promise): Error: Type dataGrid is part of the declarations of 2 modules: DataGridModule and DataGridModule! Please consider moving dataGrid to a higher module that imports DataGridModule and DataGridModule. You can also create a new NgModule that exports and includes dataGrid then import that NgModule in DataGridModule and DataGridModule.
DataGridModule:
import {Compiler, Component,NgModule} from '@angular/core';
import { CommonModule } from '@angular/common';
import {dataGrid} from './dataGrid';
import { DataTableModule,SharedModule,DataScrollerModule } from 'primeng/primeng';
@NgModule({
imports: [DataTableModule,SharedModule,DataScrollerModule,CommonModule],
declarations: [dataGrid],
entryComponents: [] ,
exports:[dataGrid]
})
export class DataGridModule { }
Zone.Module.ts
import {NgModule} from '@angular/core';
import {SharedFormModule} from '../../../../../../../UMSToolkit/UIToolkit/shared/shared-form.module';
import {DataGridModule} from '../../../../../../../UMSToolkit/UIToolkit/xdata/view/datagrid.module';
import {ZoneRoutingModule} from './Zone-routing.module';
import {RevertModule} from '../../shared/Revert.module'
@NgModule({
imports: [SharedFormModule,DataGridModule,ZoneRoutingModule,RevertModule],
declarations: [],
bootstrap: [ ],
entryComponents: [],
providers: []
})
export class ZoneModule { }
BasicDataGrid module
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {DataGridModule} from '../../../../../../../../UMSToolkit/UIToolkit/xdata/view/dataGrid.module';
import {BasicDataGridComponent} from './basic-datagrid.component';
@NgModule({
imports: [DataGridModule,CommonModule],
declarations: [BasicDataGridComponent]
})
export class BasicDataGridModule
{
}
It was the typo error with case. Notice that BasicGridComponent was have dataGrid.module with a capital G causing the issue.
Thanks,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.