Storybook: Adding nested angular component ?

Created on 8 Jan 2018  路  4Comments  路  Source: storybookjs/storybook

Issue details

Adding a nested angular component which one component depends on other where those other are in different modules. If I just use the tutorial angular examples, didn't work.

Steps to reproduce

Adding a nested angular component which one component depends on other where those other are in different modules. If I just use the tutorial angular examples, didn't work.
The same error can be seen in spec test in angular. And is fixed adding in declarations the component or adding into imports the module where the nested component exist ( the second solution only works if the nested component is declared in exports ngModule ).

https://ibb.co/dTXdU6

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/angular 1.5.x

    Affected platforms

  • _If UI related, please indicate browser, OS, and version_

  • _If dependency related, please include relevant version numbers_
  • _If developer tooling related, please include the platform information_

Screenshots / Screencast / Code Snippets (Optional)

// code here
angular question / support

Most helpful comment

Everything that component needs to be rendered should be provided with
moduleMetadata. Take a look here - https://github.com/storybooks/storybook/blob/master/examples/angular-cli/src/stories/custom-metadata.stories.ts

All 4 comments

Everything that component needs to be rendered should be provided with
moduleMetadata. Take a look here - https://github.com/storybooks/storybook/blob/master/examples/angular-cli/src/stories/custom-metadata.stories.ts

Thanks this definetly will fix it!

@igor-dv I think a rich documentation will avoid opening several issues .

You are right. And we will be more than happy to get PRs with docs improvements 馃槈

Was this page helpful?
0 / 5 - 0 ratings