Skip to content

Commit

Permalink
ADD new story-level decorators to angular stories
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Mar 3, 2019
1 parent 4753e20 commit 79609ae
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 28 deletions.
19 changes: 12 additions & 7 deletions examples/angular-cli/src/stories/custom-pipes.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ storiesOf('Custom|Pipes', module)
field: 'foobar',
},
}))
.addDecorator(withKnobs)
.add('With Knobs', () => ({
component: NameComponent,
props: {
field: text('field', 'foobar'),
},
}));
.add(
'With Knobs',
() => ({
component: NameComponent,
props: {
field: text('field', 'foobar'),
},
}),
{
decorators: [withKnobs],
}
);
25 changes: 15 additions & 10 deletions examples/angular-cli/src/stories/custom-providers.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,19 @@ storiesOf('Custom|Providers', module)
name: 'Static name',
},
}))
.addDecorator(withKnobs)
.add('With knobs', () => {
const name = text('name', 'Dynamic knob');
.add(
'With knobs',
() => {
const name = text('name', 'Dynamic knob');

return {
component: ServiceComponent,
props: {
name,
},
};
});
return {
component: ServiceComponent,
props: {
name,
},
};
},
{
decorators: [withKnobs],
}
);
27 changes: 16 additions & 11 deletions examples/angular-cli/src/stories/custom-styles.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,24 @@ storiesOf('Custom|Style', module)
`,
],
}))
.addDecorator(withKnobs)
.add('With Knobs', () => ({
template: `<storybook-button-component [text]="text" (onClick)="onClick($event)"></storybook-button-component>`,
props: {
text: text('text', 'Button with custom styles'),
onClick: action('log'),
},
styles: [
`
.add(
'With Knobs',
() => ({
template: `<storybook-button-component [text]="text" (onClick)="onClick($event)"></storybook-button-component>`,
props: {
text: text('text', 'Button with custom styles'),
onClick: action('log'),
},
styles: [
`
storybook-button-component {
background-color: red;
padding: 25px;
}
`,
],
}));
],
}),
{
decorators: [withKnobs],
}
);

1 comment on commit 79609ae

@vercel
Copy link

@vercel vercel bot commented on 79609ae Mar 3, 2019

Choose a reason for hiding this comment

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

Deployment failed with the following error:

Builds rate limit exceeded (0 of 100 remaining). Try again in 24h

Please sign in to comment.