More often than not web applications need to communicate with a persistent store to fetch and manipulate data. This is especially true for CRUD-like applications where data editing is the essential part.
AngularJS is well equipped to communicate with various back-ends using XMLHttpRequest (XHR) and JSONP requests. It has a general purpose
$http service for issuing XHR and JSONP calls as well as a specialized
$resource service to easily target RESTful endpoints.
In this chapter, we are going to examine different APIs and techniques to communicate with various back-ends. In particular, we are going to learn how to:
$httpservice and test code relying on