Module and Component
Explore how to create and configure the login module and component in Angular. Understand how to build a login form, handle user input with ngModel, implement authentication, and navigate upon successful login. This lesson helps establish a foundational login feature using Angular and Cypress testing.
We'll cover the following...
Currently, we have a navbar that updates based on our logged in or logged out state, and a “Signup” link that sends us to our signup form. Now, it’s time to add our login feature for returning users.
Module setup
Similar to our signup feature, start by creating the module and component for login.
ng g module login --routing
ng g component login
The first command ng g module login --routing creates two files. Below is the expected terminal output.
CREATE src/app/login/login-routing.module.ts
CREATE src/app/login/login.module.ts
The second command ng g component login, creates four files and updates one. The terminal output should look like ...