Consider this structure; --MyModule ----Header ----HeaderLogo
I'm trying to develop angular components in storybook. I am able to see and develop a single component, but when I import component into another component (header logo into header) (same module) I'm getting the following error;
Template parse errors: 'header-logo' is not a known element: 1. If 'header-logo' is an Angular component, then verify that it is part of this module. 2. If 'header-logo' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
When I add parent module to moduleMetadata like this (to import HeaderLogo),
addDecorator(
moduleMetadata({
imports: [MyModule],
})
);
I'm getting;
index.js:19 Error: Type HeaderComponent is part of the declarations of 2 modules: MyModule and DynamicModule! Please consider moving HeaderComponent to a higher module that imports MyModule and DynamicModule. You can also create a new NgModule that exports and includes HeaderComponent then import that NgModule in MyModule and DynamicModule.
How can I make this work?