One of the most fundamental components of AngularJS functionality is services. Services provide task-based functionality to your applications. Think about a service as a chunk of reusable code that performs one or more related tasks. AngularJS provides several built-in services and also enables you to create your own customized services.
This chapter introduces the AngularJS services. You will get a chance to see and implement some of the built-in services, such as $http
for web server communication, $cookieStore
for storing and retrieving browser cookies, and $animate
to provide animation capabilities.