O'Reilly logo

Mastering AngularJS for .NET Developers by Mohammad Wadood Majid, Golrokh Mirzaei

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

The difference between $http and $resource

In the previous sections, we implemented $http and $resource. In this section, we will discuss the differences between $http and $resource of the AngularJS framework. This table shows the difference between the two approaches:

$http

$resource

$http is for universal purpose. It is an Ajax call.

$resource warps $http for use in RESTful web APIs.

$http is built into the AngularJS framework.

$resource needs to add the module separately.

$http is good for quick retrieval.

$resource is good for conditions slightly more complex than $http.

$http is injected directly into an AngularJS controller by the developer.

$resource does not allow us to do much with data once it is consumed in the application. ...

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