Storybook Angualr and ng-bootstrap

Viewed 697

I want to create stories for angular components that use ng-bootstrap. However when i make these stories for example for this example code ( all component are working only storybook gives the errors)

<div id="{{collapseName}}" [ngbCollapse]="isCollapsed">

i get the following error.

Can't bind to 'ngbCollapse' since it isn't a known property of 'div'.

How do I make a basic story that supports this

1 Answers

As the error states, ngbCollapse is not a property of div, it's a directive included in NgbModule. You have to import that module to be able to use it in your application. If you want to use the directives from NgbModule in different components, you could import and export NgbModule in your SharedModule, and then import SharedModule in all your modules.

I would recommend taking a look at https://ng-bootstrap.github.io/#/getting-started

Related