top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between $http and $resource?

0 votes
287 views
What is the difference between $http and $resource?
posted Nov 11, 2017 by Latha

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

$http service is a core Angular service which allows you to make AJAX requests by using GET, HEAD, POST,
PUT, DELETE, JSONP and PATCH methods. It is very much like the $.ajax() method in jQuery. It can be used with
RESTful and Non-RESTful server-side data sources.
$http is good for quick retrieval of server-side data that doesn’t really need any specific structure or complex
behaviors.
$resource warps $http and allows you to interact with RESTful server-side data sources. It requires the ngResource
module to be installed which exist in angular-resource.js
$http is good for retrieval of RESTful server-side data sources that might need any specific structure or complex
behaviors.

answer Nov 11, 2017 by Shivaranjini
...