I'm currently working with Storybook and Angular. I can't seem to change the value of an Observable in one of my component. Nothing is showing up on the storybook.
I've tried to do of(true) to change the value, but it doesn't seem to work even without it. Tried inspecting the element but there is nothing so I assume that it didn't do anything.
My story:
stories.add('Loader', () => {
return {
template: `
<rpg-loader>
</rpg-loader>
`,
props: {
isLoading$: boolean('isLoading$', of(true))
}
};
});
My Component:
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'rpg-loader',
templateUrl: './loader.html',
styleUrls: ['./loader.scss']
})
export class LoaderComponent implements OnInit {
isLoading$: Observable<boolean>;
constructor(
private loadingProvider: LoadingProvider
) { }
ngOnInit() {
this.isLoading$ = this.loadingProvider.getLoadingState();
}
}
I expect the storybook to show me the actual component and that I can toggle it within a knob but there is nothing.