Interviews - C# Corner

Gajendra Jangid
What are role of services in Angular?
By Gajendra Jangid in Angular onMar 10 2018
  • Asif Khan
    Mar, 2018 13

    Services are separation of concerns. It is a bridge between backend/server side components and UI components. You can use service as a plug and play component. This helps in making the project more testable as you have better mocking entry points. Also using the services you can make your angular component very light as you can load only services which are required for the component by injecting them in the constructor.

    • 3
  • Dharmendra Pawar
    Apr, 2018 29

    The service is used to serve the data. Below are uses of services. It can be connected to database through HttpClient It can be served JSON Object . It can be used for authentication.

    • 1
  • t.santosh rao
    Apr, 2018 18

    functions to access over the all controllers

    • 1
  • Mahesh Verma
    Mar, 2018 13

    Basically, by the help of services, you can easily separation of your code which communicates with the database. Most of the method we used in services are directly talked to the database and fetch the data. Now, this is reusable, you can inject this any of the component (if the version is greater than angular 1) and any of the controller (if the version is 1). One more important use of service is to pass data between controllers and components.

    • 1

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS