O'Reilly logo

AngularJS in Action by Lukas Ruebbelke with Brian Ford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Models and services

This chapter covers

  • The vital role that models and services play
  • Different types of services and how to create them
  • Using $http to communicate with remote servers
  • How promises handle asynchronous communication
  • Using $http interceptors
  • How to use decorators to enhance services
  • Testing models and services

If a controller is supposed to be lightweight and only concern itself with the view it’s controlling, what happens when you need functionality to be available to your entire application? If a controller should never communicate directly with other controllers, how do they share information? Whereas controllers are constrained to a specific context, AngularJS services exist to provide functionality that’s ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required