image.png
Error: Type Modders is part of the declarations of 2 modules: BackAppModule and TskAppModule!
Please consider moving Modders to a higher module that imports BackAppModule and TskAppModule.
You can also create a new NgModule that exports and includes Modders then import that NgModule in BackAppModule and TskAppModule.
一個組件在兩個模塊中使用,導(dǎo)致報錯勿锅。
將該組件定義到獨(dú)立模塊帕膜,在其他模塊中引用該模塊。
// 定義一個獨(dú)立模塊
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {InfoComponent} from "../info/info.component";
@NgModule({
imports: [CommonModule],
exports: [ InfoComponent ],
declarations: [InfoComponent]
})
export class InfoModule {}
// 引入到兩個模塊中
import { InfoModule } from '../common/tsk.common.module';
@NgModule({
imports:[InfoModule ],
declarations:[
FnshListCmpt
]})
export class FnshAppModule{}