I've been trying to improve my application - rather than being one monolithic application with everything declared in the app module - I wanted to move certain components into feature modules. However, in places where I had some data binding from one component - to another outside of the module this has broke the code.
ResultDetailsComponent Template
<div class="col-9">
<app-links-table [loaded]="dataLoaded" [dataLinkResult]="dataLinkResult"></app-links-table>
</div>
The ResultDetailsComponent now belongs to the ItemsModule in which I declare and export it.
@NgModule({
declarations: [
ResultDetailsComponent,
],
exports: [
ResultDetailsComponent
]
})
export class ItemsModule { }
The LinksTableComponent (app-links-table) contains the correct inputs for the data binding
export class LinksTableComponent {
@Input() loaded: boolean;
@Input() dataLinkResult: Link[];
}
And this is, for the moment - still declared in the main AppModule, though I plan on moving it out into it's own feature module.
@NgModule({
declarations: [
LinksTableComponent,
],
exports: [
LinksTableComponent
],
bootstrap: [AppComponent]
})
export class AppModule { }
Is the answer that I need to create a service now to communicate between these components? Or is something about my structure just fundamentally wrong?