-1

In the PhoneCat Tutorial in AngularJS site, it is suggested to replace http.get with our own custom service. https://docs.angularjs.org/tutorial/step_11 Besides making the code modular is there any other use of this ? (Read somewhere that services are called just once, unlike controllers. Not sure about that though)

abhivij
  • 117
  • 8
  • I just want to know what is the use of defining our own service when there is an inbuilt http.get. Can the service do something else ? IMHO answer to this would involve facts besides just opinion. – abhivij Jul 15 '14 at 12:28

1 Answers1

0

Well, in my opinion the reason using service as data besides its readability is that the service in injectable to other modules, but not the controller.

further reading:

more here

Community
  • 1
  • 1
mcn
  • 711
  • 4
  • 9