Book Image

Mastering AngularJS for .NET Developers

By : Mohammad Wadood Majid, Golrokh Mirzaei
Book Image

Mastering AngularJS for .NET Developers

By: Mohammad Wadood Majid, Golrokh Mirzaei

Overview of this book

<p>AngularJS is an open source framework that utilizes the Model-View-Controller architecture for client-side application development. AngularJS is referred to as the Angular framework.</p> <p>With this book, you will soon be able to build client-side data driven applications. The introduction section covers the essentials of AngularJS, covering the core concepts of AngularJS to ensure a smooth transition to the more advanced topics discussed later on.</p> <p>This book covers the development of client-side applications with AngularJS using code examples before moving on to explore how to build the ASP.NET Web API and its features using Visual Studio .NET.</p>
Table of Contents (15 chapters)
Mastering AngularJS for .NET Developers
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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. It is in the final state when it is delivered to the HTML DOM. The data is the same that the $http method will receive.