From the course: Building Angular and ASP.NET Web API Apps

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Creating an Angular login component

Creating an Angular login component

From the course: Building Angular and ASP.NET Web API Apps

Start my 1-month free trial

Creating an Angular login component

- [Instructor] We have seen so far how to register a user, and how to log out a user. But if we want to log in using the credentials of an existing user, that is not possible at the moment. So, on this part, we are going to start implementing the user login feature. And to do so, we will first create a component using the angular CLI. Add the component to the routing module, and then we will design the view. And then at the end we are going to send a request to our back end API. So, let's get started. In our angular project, open the terminal, and in here type ng generate a component named login, and then configure this component in our app module file. And then press enter. So in the source folder, inside the app folder, you are going to see a new component, the login component. Now to be able to use this component, we need to configure it in our router module, so for that go to the app-router.module.ts file. In here, import the new components of import, login component, and then…

Contents