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

Unlock the full course today

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

Setting up AuthService

Setting up AuthService

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

Start my 1-month free trial

Setting up AuthService

- [Instructor] On the last part, we partially set up the authentication controller. And on this part, we going to set up the authentication service in Angular. We're going to use this service to send the data and handle the response from the API Endpoints of the authentication controller. So, let us first create this service. To create a service in Angular using the Angular CLI you need to write NG and then generate a service. We're going to name this service auth and then press enter. Now that this service was generated, you can go inside the source folder, then inside the app folder you're going to see the auth.service.ts file. To be able to use this service, we need to configure it in our application module. So go to the app.module.ts file, in the services part, import this service. So write that you import, AuthService (Instructor types on keyboard) from ./auth.service. (Instructor types on keyboard) So we imported the service, let us configure it in our services section. So, in…

Contents