O'Reilly logo

Mastering Web Application Development with AngularJS by Pawel Kozlowski, Peter Bacon Darwin

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

Communicating with RESTful endpoints

The Representational State Transfer (REST) is a popular architectural choice for exposing services over a network. The interface provided by $http allows us to easily interact with RESTful endpoints from any AngularJS-based web application. But AngularJS goes one step further, and provides a dedicated $resource service to make interactions with RESTful endpoints even easier.

The $resource service

RESTful endpoints often expose CRUD operations that are accessible by calling different HTTP methods on a set of similar URLs. The code that interacts witch such endpoints is usually straightforward but tedious to write. The $resource service allows us to eliminate the repetitive code. We can also start to operate on ...

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