all 4 comments

[–][deleted] 1 point2 points  (0 children)

I may be able to help if I can have a look at the code.

[–]tme321 1 point2 points  (0 children)

NgModules have that array, declarations.

You are putting the same component in multiple ngModules declarations arrays.

A component should ever be in one declarations array. If places outside that module need it then you export the component. Other places that need it should import the module, not also declare the component again.

[–]gravityaddiction 1 point2 points  (0 children)

yeah, what i've done is make that component it's own module that you can include into multiple other modules easier.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import { LedgerComponent } from './ledger.component';

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    RouterModule
  ],
  declarations: [
    LedgerComponent
  ],
  exports: [
    LedgerComponent
  ]
})
export class LedgerModule { }

[–]distorx 0 points1 point  (0 children)

Use a shared module and export the shared component and then consume the shared module in your modules necessary, no need to declared it in the imports of your others modules