Search⌘ K

Add Signup Routing Feature

Explore how to add a signup routing feature in Angular by creating a feature module with routing, generating a signup component, and setting up lazy loading. Understand how to configure routing modules to correctly display signup pages and optimize application startup.

We can now create our first feature module to consume the signup method in our service.

Routing

First, we’ll create our signup module using the --routing flag to create a routing file for our module. Then, we’ll create the signup component.

ng g module signup --routing
ng g component signup
Terminal 1
Terminal
Loading...

The above command ng g module signup --routing creates two files. This should be the terminal output:

CREATE src/app/signup/signup-routing.module.ts
CREATE src/app/signup/signup.module.ts

The second command ng g component signup creates four files and updates one. The terminal should log output similar to this:

CREATE src/app/signup/signup.component.cs
...