Question
The component is declared by more than one NgModule
So i created a component ExampleComponent and declared it in a module that isnt listed in app.module. Next i want to declare the component ExampleComponent in a module that is listed in app.module. How do i do this? If i simply declare it, than i get the following error: the component ExampleComponent is declared by more than one NgModule.
abc.module.ts
import { ExampleComponent } from '../Example/Example.component';
@NgModule({
declarations: [
ExampleComponent
]
})
app.module.ts
import { NewModule } from '../new/new.component';
@NgModule({
imports: [
NewModule
declarations: [
]
})
new.module
import { ExampleComponent } from '../Example/Example.component';
@NgModule({
declarations: [
ExampleComponent
]
})