You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @valentinpalkovic , thanks for the fast reply. I have created the PR #25212. I'm having some trouble setting up my local project to test it though.
I'm getting some errors while running the project with yarn task --task dev start-from auto --template angular-cli/default-ts. Maybe I didn't setup the project correctly or missing some task.
Describe the bug
Setting component docs with a componentWrapperDecorator shows the wrapper code in the "Show Code". To exclude the wrapper code you can set a parameter on the component as described below.
According to examples, and for React (https://github.com/storybookjs/storybook/blob/v7.6.3/code/renderers/react/src/docs/jsxDecorator.tsx) you can just set the following parameter:
However, this does not work when using @storybook/angular. I found out on your code that you do not take into account the excludeDecorators flag.(https://github.com/storybookjs/storybook/blob/v7.6.3/code/frameworks/angular/src/client/docs/sourceDecorator.ts)
A possible solution:
File: https://github.com/storybookjs/storybook/blob/v7.6.3/code/frameworks/angular/src/client/docs/sourceDecorator.ts
Change from:
if (component && !userDefinedTemplate) {
To:
if (component && !userDefinedTemplate || component && context?.parameters.docs?.source?.excludeDecorators)
To Reproduce
Use @storybook/angular.
Have a component with docs.
Add the following Decorator:
componentWrapperDecorator((story) =>
),
Add the following parameters:
parameters: { docs: { source: { excludeDecorators: true, } } },
Click on the "Show Code" and you will see that the
<div style="margin: 5em">...YourComponent</div>
shows instead of just YourComponent.System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: