Angular and Storybook – Mock Data in Component

Loading

Reading Time: 5 minutes Introduction After building a few presentational components, I am ready to build a container component, food menu component, with them. Food menu component is responsible for displaying an option dropdown and a list of menu items. This is the component tree of food menu component. The functions of food menu component are to retrieve menu … Read more

Angular and Storybook – Component with content projection

Loading

Reading Time: 3 minutes In Bonnie’s visual DOM course, I learnt the technique of applying multiple content projections in a component. I created a FoodMenuCardComponent with two content projections; i.e., a component with two <ng-content> elements. The first <ng-content> has selector ‘head’ that projects FoodQuestion component and the second <ng-content> has selector ‘body’ that projects a list of FoodChoice … Read more