Skip to content

Commit

Permalink
Merge pull request #14532 from lordVelisch/feature/add_angular_snippe…
Browse files Browse the repository at this point in the history
…t_args

docs: add angular code snippet for using args
  • Loading branch information
shilman committed Apr 14, 2021
1 parent 956a251 commit 30179aa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions docs/snippets/angular/page-story-slots.ts.mdx
@@ -0,0 +1,25 @@
```ts
// Page.stories.ts

import { Meta, Story } from '@storybook/angular/types-6-0';
import Page from './page.component';

export default {
component: Page,
title: 'Page',
} as Meta;

const Template: Story<Page> = (args) => ({
props: args,
template: `
<storybook-page>
<ng-container footer>${args.footer}</ng-container>
</storybook-page>`,
});

export const CustomFooter = Template.bind({});
CustomFooter.args = {
footer: 'Built with Storybook',
};

```
1 change: 1 addition & 0 deletions docs/writing-stories/args.md
Expand Up @@ -114,6 +114,7 @@ Args are used in story templates to configure the component appearance just as y
'react/page-story-slots.ts.mdx',
'vue/page-story-slots.2.js.mdx',
'vue/page-story-slots.3.js.mdx',
'angular/page-story-slots.ts.mdx'
]}
/>

Expand Down

0 comments on commit 30179aa

Please sign in to comment.