Is there a way to write a Storybook story for an angular component so the inner html/text is transcluded in the rendered storybook?
Here my attempt which is rendered without the transcluded inner text of testing
Button component:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'open-button',
templateUrl: './button.component.html',
styleUrls: ['./button.component.scss']
})
export class ButtonComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
Button component template:
<button type="button">
<ng-content></ng-content>
</button>
Story:
storiesOf('Button', module)
.add('Basic Button', () => ({
component: ButtonComponent,
template:
`
<open-button class="primary" type="button">testing</open-button>
`,
}));
Rendered as:
<open-button _nghost-c8="">
<button _ngcontent-c8="" type="button">
</button>
</open-button>