Services contain reusable business logic. Angular uses Dependency Injection (DI) to provide services to components.
ng generate service user
constructor(private userService: UserService) {}
this.userService.getUsers();
Take quizzes related to this topic and see where you stand!
Start Quiz Now