storybook/docs/snippets/angular/list-story-expanded.ts.mdx
2021-09-03 23:31:04 +01:00

51 lines
910 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: '<app-list></app-list>',
}),
};
export const OneItem = {
render: (args) => ({
props: args,
template: `
<app-list>
<app-listitem></app-listitem>
</app-list>`,
}),
};
export const ManyItems = {
render: (args) => ({
props: args,
template: `
<app-list>
<app-listitem></app-listitem>
<app-listitem></app-listitem>
<app-listitem></app-listitem>
</app-list>
`,
}),
};
```