i have this psuedo code structure in my angular project.
wrapper.module
Wrapper.module.ts
@NgModule({
declaration: [WrapperComponent.ts]
imports: [
WrapperRouting.module
]
})
wrapper-routing.module.ts
WrapperRouting.module
routes = [
{
path: '',
component: wrapper.component.ts ,
children: [
{ path: '', loadChildren: Component1.module.ts},
{ path: '2', loadChildren: Component2.module.ts},
]
}
];
component1.module.ts
@NgModule({
declaration: [Component1Component, ShowTableComponent]
imports: [
Component1Routing.module
]
})
component1.component.ts
<show-table></show-table>
component2.module.ts
@NgModule({
declaration: [Component2Component, ShowTableComponent]
imports: [
Component2Routing.module
]
})
component2.component.ts
<show-table></show-table>
Im trying first to declar the ShowComponent in Component1.module.ts and Component2.module.ts however I got an error that ShowComponent is declared in two module.
Then, tried to put in the the parent module which is Wrapper.module.ts the error would be: ShowComponent is an Angular component, then verify that it is part of this module.
Can someone help me, much appreciated!