Answers for "is declared by more than one NgModule."

2

is declared by more than one NgModule.

You can't declare a component in more than 1 module.
If both modules need it, you need to declare/export your component in a third
module and imports this one in abc & def.

@NgModule({
  imports:      [ MainModule ]
})
export class AbcModule { }

@NgModule({
  imports:      [ MainModule ]
})
export class DefModule { }

@NgModule({
  declarations: [ CommonMod ],
  exports:    [ CommonMod ]
})
export class MainModule { }
Posted by: Guest on August-03-2020

Code answers related to "is declared by more than one NgModule."

Code answers related to "TypeScript"

Browse Popular Code Answers by Language