Either add ScrollToWhen to ModuleA , or move it to a module, which you can then add to imports: [...] from ModuleA to make it available.
A component / directive can be specified in only one single module in declarations: [...] . Then import this module wherever you want to use this component / directive.
For the module used to declare directives and the channel, you need to install them in exports as:
@NgModule({ declarations: [ myDirectives ], exports: [ myDirectives ] })
source share