I\'ve just run into a problem with a lazy-loaded module where parent and child module both require the same service but create an instance each. The declaration is identical
I have a separate layout module with a service, this service needed to work on other feature modules, using lazy load
I was able to solve the problem by exporting the service, straight from the layout module
@NgModule({
declarations: [...],
imports: [...],
exports: [...],
})
export class LayoutModule {
...
}
export { LayoutService }