Understanding Custom AngularJS Services

AngularJS enables you to create your own custom services to provide functionality in AngularJS components that require it. As you saw in the previous chapter, the built-in AngularJS services provide a wide variety of functionality for AngularJS applications. Using custom services, you can customize, enhance, and extend that functionality in many ways.

There are four main types of services that you will likely be implementing in your code: value, constant, factory, and service. The following sections cover these services.

Get Learning AngularJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.