Header component

To begin with, implement the header component by following these steps:

  1. 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).

  1. Replace the HTML file /src/app/modules/shared/header/header.component.html ...

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.