storybook/docs/snippets/angular/my-component-with-env-variables.ts.mdx
2021-03-09 15:26:53 +00:00

21 lines
446 B
Plaintext

```ts
// MyComponent.stories.ts
import { Story, Meta } from '@storybook/angular/types-6-0';
import MyComponent from './mycomponent.component';
export default {
component: MyComponent,
title: 'A story using environment variables inside a .env file',
} as Meta;
const Template: Story<MyComponent> = (args) => ({
props: args
});
export const Default = Template.bind({});
Default.args = {
propertyA: process.env.STORYBOOK_DATA_KEY
};
```