storybook/docs/snippets/angular/list-story-expanded.ts.mdx
2021-09-06 22:03:15 +01:00

51 lines
874 B
Plaintext

```ts
// List.stories.ts
import { moduleMetadata } from '@storybook/angular';
import { CommonModule } from '@angular/common';
import { List } from './list.component';
import { ListItem } from './list-item.component';
export default {
component: List,
decorators: [
moduleMetadata({
declarations: [List, ListItem],
imports: [CommonModule],
}),
],
};
export const Empty = {
render: (args) => ({
props: args,
template: '<list></list>',
}),
};
export const OneItem = {
render: (args) => ({
props: args,
template: `
<list>
<list-item></app-list-item>
</app-list>`,
}),
};
export const ManyItems = {
render: (args) => ({
props: args,
template: `
<list>
<list-item></list-item>
<list-item></list-item>
<list-item></list-item>
</app-list>
`,
}),
};
```