Follow by Email

AngularJS RESTful Resources


1) The $http service provides a very low-level implementation that allows you to make XHR requests, and provides control and flexibility. But most of the times,we work with objects and object models that are encapsulated with certain properties and methods.

2) Use the properties of this object, like save, update , delete etc.

 Angular JS ($resource) resources allow us to define object models in a descriptive manner as follows :
• Some additional methods like get, save, query, remove, and
delete that encapsulate specific functionality and business logic for the
object model like online transactions.

When to Use Angular Resources

Use Angular resources if your server side behaves in a RESTful manner.
For the case of a on-line mobile recharge, which we are using as an example.
1. A GET request to  returns a list of transactions from a particular customer.
2. A GET request to transaction request by using the transaction ID.