Question:What is the difference between $http and $resource? 

Answer $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. 

+ Report
Total Preview: 1777
What is the difference between $http and $resource?
Copyright © 2024. Powered by Intellect Software Ltd