...

/

Importing and Exporting Modules

Importing and Exporting Modules

We'll learn how to import and export a module so that we can share components.

We'll cover the following...

In the previous lesson, if you run the code, nothing changes in the application. It’s still rendering the default page.

There are two reasons for this. First, modules don’t render content. That’s the job of components. Second, Angular will not register the other modules for you. Unlike components, directives, or pipes, modules need to be registered manually.

Let’s create a component that will render the content for the homepage.

Creating components

In the command line, run the following command:

ng generate component home/home-main

The command is slightly ...