Skip to content

Commit

Permalink
Angular: Add repro for #11613 #11614
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Jul 22, 2020
1 parent 2585ac9 commit 0670442
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
41 changes: 41 additions & 0 deletions examples/angular-cli/src/stories/issue-11613/label.component.ts
@@ -0,0 +1,41 @@
import { Component, Input, OnInit } from '@angular/core';

@Component({
selector: 'storybook-label-component',
template: `
<div [style.background-color]="bgColor">{{ text }}</div>
<div>{{ localText }}</div>
`,
styles: [
`
button {
border: 1px solid #eee;
border-radius: 3px;
background-color: #ffffff;
cursor: pointer;
font-size: 15px;
padding: 3px 10px;
margin: 10px;
}
`,
],
})
export default class LabelComponent implements OnInit {
/**
* Specify the Label text
*/
@Input()
text = '';

/**
* Specify the label's bgColor
*/
@Input()
bgColor: string;

localText = 'Original localText';

ngOnInit() {
this.localText = 'Updated localText';
}
}
23 changes: 23 additions & 0 deletions examples/angular-cli/src/stories/issue-11613/label.stories.ts
@@ -0,0 +1,23 @@
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';

import Label from './label.component';

export default {
title: 'issues/11613',
component: Label,
argTypes: {
text: { control: 'text' },
bgColor: { control: { type: 'select', options: ['#ff0', '#F00', '#0F0'] } },
},
};

const Template = (args: Label) => ({
component: Label,
props: args,
});

export const LabelText = Template.bind({});
LabelText.args = {
text: 'Default Label',
};

0 comments on commit 0670442

Please sign in to comment.