Skip to content

Conversation

@x1c0
Copy link
Contributor

@x1c0 x1c0 commented Mar 20, 2018

Issue:

What I did

I extended documentation on how to use knob inputs in Angular

How to test

Is this testable with jest or storyshots?
No

Does this need a new example in the kitchen sink apps?
Maybe we could add one?

Does this need an update to the documentation?
N/A

If your answer is yes to any of these, please make sure to include it in your PR.


const stories = storiesOf('Storybook Knobs', module);

// The "addDecorator" must come before the "add"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say

"withKnobs" decorator should be applied before the stories using knobs

stories.add('with text', () => ({
component: Button,
props: {
text: text('text', 'Hello Button'), // The first param on the text knob has to be exactly the same as the component input.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first param of the knob function.

Copy link
Member

@igor-dv igor-dv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hypnosphi Hypnosphi added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Mar 21, 2018
@Hypnosphi Hypnosphi merged commit 7717d47 into storybookjs:master Mar 21, 2018
@Hypnosphi Hypnosphi added the patch:done Patch/release PRs already cherry-picked to main/release branch label Mar 29, 2018
Hypnosphi added a commit that referenced this pull request Mar 29, 2018
extend documentation on how to use knob in Angular
@ghost ghost mentioned this pull request Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addon: knobs angular documentation patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants