Storybook 6.2.0-beta new angular renderer ovverides properties
See original GitHub issueDescribe the bug if component has some properties that are not inputs they are overridden
export class SampleComp{
@Input() input1: string;
notInputProperty: string;
ngOnChanges(){
this.notInputProperty = 'kokos';
}
}
and template will be
notInputProperty : {{notInputProperty }}
then notInputProperty will be overridden after change detection we will get rendered ```notInputProperty : `.
if we add @Input decorator to this property then it works as it should and we get rendered: ```notInputProperty : kokos’.
setting angularLegacyRendering: true, solves the issue.
export default {
title: 'Components/Core/SampleComp',
component: SampleComp,
decorators: [
moduleMetadata({
declarations: [SampleComp],
}),
],
} as Meta;
const Template: Story<SampleComp> = (args) => ({
props: args,
});
export const Sample = Template.bind({});
Sample.args = {};
fun fact:
after first time storybooks renders You will change the name of property to lets say notInputProperty2 then it will work!
So maybe it has something to do with controls?
Restarting storybook (ctr+c) and npm run storybook again will again cause it to be overridden till You again change the name of property to lets say notInputProperty3.
System
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
Binaries:
Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 88.0.4324.190
Edge: Spartan (44.19041.423.0), Chromium (88.0.705.81)
npmPackages:
@storybook/addon-actions: 6.2.0-beta.10 => 6.2.0-beta.10
@storybook/addon-centered: 5.3.21 => 5.3.21
@storybook/addon-essentials: 6.2.0-beta.10 => 6.2.0-beta.10
@storybook/addon-links: 6.2.0-beta.10 => 6.2.0-beta.10
@storybook/addon-storysource: 6.2.0-beta.10 => 6.2.0-beta.10
@storybook/angular: 6.2.0-beta.10 => 6.2.0-beta.10
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)

Top Related StackOverflow Question
Hi, the problem still persists and the workaround also doesn’t work anymore.
Storybook: v6.50-alpha.14 Compodoc: v1.1.18 Angular: v13
In case it helps anyone else who ends up here I added
--disablePrivate,--disableInternaland--disableLifeCycleHooksto the storybook buildercompodocArgsoptions to get it to stop finding the private properties. Added in theangular.json:Another workaround that I don’t like as much is to set the parameters on my story to either exclude or include the properties from the controls.