Closed marcopolo25 closed 2 years ago
Hi there! Thanks for filing an issue!
Actually, in the case of Angular + Storybook, Nx uses the native Storybook builders for serving and building Storybook. So, any issues you notice that are unexpected, maybe you should post an issue on the Storybook repository.
In any case, following the steps you posted, will result in creating a story for a component with no controls specified. If you add some @Inputs
, and run the stories
generator again, you will have controls.
This is the result of the story with no controls:
This is the component you described:
This is the resulting story:
Now if you add some inputs in the component, for example:
export class UiTestComponent implements OnInit {
@Input() name = 'katerina';
and you change the template (libs/shared/storybook-test/src/lib/ui-test/ui-test.component.html
):
<h1>{{ name }}</h1>
and you change the stories file (libs/shared/storybook-test/src/lib/ui-test/ui-test.component.stories.ts
) to have the controls (args):
export const Primary = Template.bind({});
Primary.args = {
name: 'katerina',
};
and you run Storybook again, you will see the controls:
Now, if the control panel still does not show, hit A
or D
on your keyboard, it may just be hidden. Or clear cookies and refresh.
Again, this is on the Storybook side, not the Nx side!
Thank you, hope I helped!
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
When running a storybook story for an angular component, the controls section of the story's canvas panel is not showing. The controls enables you to graphically interface with the angular components inputs and outputs.
Current Behavior
When browsing an angular component's story in nx nrwl storybook, the control panel does not display.
Expected Behavior
The controls section should to display in the component's storybook story canvas panel below the storybook ui pane.
Steps to Reproduce
Create a new angular nx workspace. Default all the other options.
npx create-nx-workspace@latest
Create a
shared
folder in the workspace libs folder.Run nx nrwl genrator to create a new angular library -
storybook-test
.npx nx generate @nrwl/angular:library storybook-test --no-interactive --dry-run
Run nx console to generate a new angular component
ui-storybook-test
in theshared-storybook-test
.npx nx generate @nrwl/angular:component ui-storybook-test --no-interactive --dry-run
Run nx console to generate a storybook configuration for the
storybook-test
lib.npx nx generate @nrwl/angular:storybook-configuration storybook-test-lib --no-interactive --dry-run
Run nx console to generate stories for the
storybook-test
lib. This will create stories for every angular component in thestorybook-test
library, including the ui-storybook-test.npx nx generate @nrwl/angular:storybook-configuration storybook-test-lib --no-interactive --dry-run
Use nx console to run the storybook for the
ui-storybook-test
.npx nx run storybook-test-lib:storybook
In the canvas pane of the component story, the controls pane is not showing. Even if you toggle the add-on controls option in the storybook menu.
Here's the my package.json
Failure Logs
No Failed logs
Screenshots
No controls panel
Expected behavior