O'Reilly logo

AngularJS: Novice to Ninja by Sandeep Panda

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 5AngularJS Services, Factories, and Providers

We've already mentioned services several times in the last few chapters. You have already used several built-in AngularJS services like $location, $timeout, $rootScope etc. But, in a real world application, the built-in services are not always going to be sufficient so you'll need to create custom services. This chapter will give you a comprehensive guide to three critical components of AngularJS: services, factories, and providers.

The main purpose of these components is that they hold some logic that's required at multiple points within your app. Although services, factories and providers are all used to accomplish the same task (encapsulating repetitive logic), there are subtle differences ...

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