Let's explore some more Nx plugins by generating and running a storybook configuration for our shared store header.
- Explore other Nx plugins to create a storybook configuration
App Screenshot
No change in how the app looks!-
yarn add @nrwl/storybook
-
Use the
@nrwl/angular:storybook-configuration
generator to generate a storybook configuration for thestore-ui-shared
project⚠️ Answer YES to all questions -
Inside
libs/store/ui-shared/src/lib/header/header.component.stories.ts
:- Import the
MatToolbarModule
- Import the Angular Material Theme
🐳 Hint
//IMPORT TOOLBAR MODULE import { MatToolbarModule } from '@angular/material/toolbar'; //IMPORT THEME import '@angular/material/prebuilt-themes/deeppurple-amber.css'; //...... export const primary = () => ({ moduleMetadata: { imports: [MatToolbarModule] // <-- import the module } //... });
- Import the
-
Serve storybook!
🐳 Hint
nx storybook store-ui-shared
-
Start typing in different titles and see how they appear in the header
-
Inspect what changed from the last time you committed, then commit your changes
🎓If you get stuck, check out the solution