Hi guys! First of all, thank you for this great library.
My question is how can i change props in angular component story dynamically?
Story for example:
let enabled = true;
storiesOf('MySuperDirective', module)
.addDecorator(
moduleMetadata({
declarations: [MySuperDirective]
})
)
.add('toggle directive', () => {
return {
template: `
<div [mySuperDirective]="enabled"></div>
<button (click)="toggleEnabled()">toggle</button>
`,
props: {
toggleEnabled: () => {
enabled = !enabled;
},
isEnabled: () => enabled
}
//want to
//enabled: true
};
})
I can't find an example in documentation
https://storybook.js.org/basics/guide-angular/
or https://release-3-4--storybooks-angular.netlify.com/
And for now i can do it only with closures as you can see.
(I want just to pass props { enabled: true} and then change it when story already running)
Windows 10
Chrome 66
Can't the knobs addon help you with it?
thank you!
Hi @nickbullock. How did you solve this problem? I don't see too much documentation on this.
Are there any plans to support updating props values? Knobs is good for updating values but not for handling event based updates.
Most helpful comment
Are there any plans to support updating props values? Knobs is good for updating values but not for handling event based updates.