Adding Routes

In this lesson, we'll add routes to our application and generate some components.

We’re going to create some components and routes for the application we’re building. We’ll have two forms: one for logging in and another for registration. Both forms will be displayed on their own pages.

Performing this task should be familiar to you. We’ve gone over how to create components and register them as routes. Take a moment to try this on your own. Don’t worry if you can’t; we’ll go over the solution together. Good luck!

Generating components

Let’s try creating the components first. In the command line, run the following command:

ng generate component Login

This will be the component for the login form. In the login.component.html template file, we’ll replace the current contents of the file with the following:

Get hands-on with 1200+ tech skills courses.