To begin with, implement the header component by following these steps:
- Generate the component using Angular CLI by executing the following command:
ng generate component modules/shared/header
What happens behind the scenes of the generate command?
Generating a component via Angular CLI performs multiple changes. It creates the Component class, style, and template files by default, and registers the component with the relative module by adding the component to the modules' declarations, which in this instance is SharedModule.
In Angular, the common naming convention is kebab (dash) case, followed by a dot and the unit type (for example, component, directive, service, and so on).
- Replace the HTML file /src/app/modules/shared/header/header.component.html ...