What is the difference between $http and $resource?

Answer Posted / chaitanya

$http is good for quick retrieval of server-side data that doesn’t really need any specific structure or complex behaviors. $http is good for retrieval of RESTful server-side data sources that might 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

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between link and compile?

444


What is the use of restrict and template property when creating custom directives?

447


When will nginit be called?

439


Is webpack necessary for angular?

414


What is injectable in angular2?

456






What are the features of angular?

416


What does :host-context() pseudo-class selector target?

424


Explain ng-bind and ng-bind-html directives.

466


What sre the directives in angularjs?

455


What is isolate scope in angularjs and why it is required?

463


What is the use of ngfortrackby directive?

442


What is the difference between angularjs and node.js?

417


What is lazy loading in angular 2?

437


What is [( ngmodel )]?

414


What is a mocked service in angularjs? How to use it?

430