Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Args parameter of the Story template has undefined properties when first load (Angular) #14732

Closed
VolAndriienko opened this issue Apr 27, 2021 · 4 comments

Comments

@VolAndriienko
Copy link

Hi.
Just updated from the version 6.1.1 to the newest version 6.2.9

Faced with the problem in image below:

args has ALL of components properties with undefined value, not only for @input or @output decorators, and the component is broken because all functions are undefined.

image

When I am clicking on the another story everything is OK and args contains only passed parameters or default values.
image

If I open first welcome page - then open the story - everything is OK.

I made temporary workaround (see on the image), just to make it work, but it's not cool to have this in the code.

Can somebody give me advise? Can't find similliar problem is others topics.

@shilman
Copy link
Member

shilman commented Apr 27, 2021

I believe this is a duplicate issue, right @ThibaudAV? We are looking into a solution in 6.3!

@ThibaudAV
Copy link
Contributor

ThibaudAV commented Apr 27, 2021

yes again and again ^^


it is necessary to control the args before adding them to angular story (for the moment 🤞 )
I know 3 ways to do it :

Prefer a "destructuring" to control them :

const Template: Story<SampleComp> = (args) => ({
  props: {
  input1: args.input1
  },
});

Use compodoc @ignore comment

like :
Add /** @ignore */ to the other properties so that compodoc ignores them

Disable doc for some kind props in compodoc

like:
"docs:json": "compodoc -p ./src/app/tsconfig.app.json -e json -d . --disablePrivate --disableProtected --disableLifeCycleHooks --disableInternal",

@shilman
Copy link
Member

shilman commented Apr 28, 2021

closing as dupe to #11613

@shilman
Copy link
Member

shilman commented May 3, 2021

Yee-haw!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.0-alpha.18 containing PR #14769 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants