I have two Modules with components which use each other. So I have to import "word" in "test" and "test" in "word" --> throw an error... How can I do ?
Module "test":
@NgModule({
declarations: [
AppTest1Component,
AppTest2Component,
],
imports: [
AppWordModule,
],
exports: [
AppTest1Component,
AppTest2Component,
],
})
export class AppTestModule {
}
Module "word":
@NgModule({
declarations: [
AppWordComponent,
],
imports: [
AppTestModule,
],
exports: [
AppWordComponent,
],
})
export class AppWordModule {
}
I import each other because of the template. The template of test1.component.ts calls word.component.ts et the template of word.component.ts calls test1.component.ts.
test1.html
<div class="app-word"></div>
word.html
<div class="app-test1"></div>
I tried to use a SharedModule but I don't achieve it...
appmodule
. and remove import module from bothmodule
– Compound