I want to declare a channel in a parent module and use it in child modules.
@NgModule({ // Pipe which I want to declare in all child modules declarations: [ ThisIsPipe ], imports: [ ChildModuleOne, ChildModuleTwo], })
How can I use It child modules?
Because if I declare it twice, I got an error
Uncaught Error: Type ThisIsPipe is part of the declarations of two modules: ChildModuleOne and ChildModuleTwo! Please consider moving ThisIsPipe to a higher module that imports ChildModuleOne and ChildModuleTwo. You can also create a new NgModule that exports and includes ThisIsPipe then imports this NgModule into ChildModuleOne and ChildModuleTwo.
source share