After creating the ExampleComponent component and declaring it in a module that is not listed in app.module, I now want to declare the same ExampleComponent in a module that is included in app.module. How can I achieve this without encountering an error stating that the component 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
]
})