Return to site

ANGULAR INTERVIEW QUESTION: What is a service?

· ngInterview,fullstack

An Angular service is a class that is generally instantiated one time during all the Angular application lifecycle, thanks to the root injector.

 

 

The goal of a service is to organize and to share the business logic between the different Angular application components.

So, an Angular service is a class that can be used in your application thanks to dependency injection that enables code sharing.